Skip to content

Commit

Permalink
Fix screenshot capture bounds (#1839)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored and brendankenny committed Mar 9, 2017
1 parent 3ba0b82 commit f1aeb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"**/dist/*",
"**/app/scripts/*",


"lighthouse-core/report/templates/*.js",
"lighthouse-core/closure"
]
Expand Down
5 changes: 5 additions & 0 deletions lighthouse-core/lib/emulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ function enableNexus5X(driver) {

return Promise.all([
driver.sendCommand('Emulation.setDeviceMetricsOverride', NEXUS5X_EMULATION_METRICS),
// required for screenshotting emulated page size, rather than full size
driver.sendCommand('Emulation.setVisibleSize', {
width: NEXUS5X_EMULATION_METRICS.screenWidth,
height: NEXUS5X_EMULATION_METRICS.screenHeight
}),
// Network.enable must be called for UA overriding to work
driver.sendCommand('Network.enable'),
driver.sendCommand('Network.setUserAgentOverride', NEXUS5X_USERAGENT),
Expand Down

0 comments on commit f1aeb58

Please sign in to comment.