| OLD | NEW |
| 1 function setMetaViewport() | 1 function setMetaViewport() |
| 2 { | 2 { |
| 3 var VIEWPORTS = { | 3 var VIEWPORTS = { |
| 4 "w=320": "width=320", | 4 "w=320": "width=320", |
| 5 "w=dw": "width=device-width", | 5 "w=dw": "width=device-width", |
| 6 "w=980": "width=980", | 6 "w=980": "width=980", |
| 7 "none": "no viewport (desktop site)" | 7 "none": "no viewport (desktop site)" |
| 8 }; | 8 }; |
| 9 | 9 |
| 10 var viewport = VIEWPORTS["none"]; | 10 var viewport = VIEWPORTS["none"]; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 var initialize_DeviceEmulationTest = function() { | 173 var initialize_DeviceEmulationTest = function() { |
| 174 | 174 |
| 175 InspectorTest.getPageMetrics = function(callback) | 175 InspectorTest.getPageMetrics = function(callback) |
| 176 { | 176 { |
| 177 InspectorTest.evaluateInPage("dumpMetrics()", callback); | 177 InspectorTest.evaluateInPage("dumpMetrics()", callback); |
| 178 } | 178 } |
| 179 | 179 |
| 180 InspectorTest.applyEmulationAndReload = function(width, height, deviceScaleFacto
r, viewport, callback) | 180 InspectorTest.applyEmulationAndReload = function(width, height, deviceScaleFacto
r, viewport, callback) |
| 181 { | 181 { |
| 182 width *= deviceScaleFactor; | |
| 183 height *= deviceScaleFactor; | |
| 184 InspectorTest.addSniffer(WebInspector.overridesSupport, "_deviceMetricsOverr
ideAppliedForTest", emulateCallback); | 182 InspectorTest.addSniffer(WebInspector.overridesSupport, "_deviceMetricsOverr
ideAppliedForTest", emulateCallback); |
| 185 WebInspector.overridesSupport.emulateDevice(width + "x" + height + "x" + dev
iceScaleFactor + "x0x0", ""); | 183 WebInspector.overridesSupport.emulateDevice(width + "x" + height + "x" + dev
iceScaleFactor + "x0x0", ""); |
| 186 | 184 |
| 187 function emulateCallback() | 185 function emulateCallback() |
| 188 { | 186 { |
| 189 var warning = WebInspector.overridesSupport.warningMessage(); | 187 var warning = WebInspector.overridesSupport.warningMessage(); |
| 190 if (warning) | 188 if (warning) |
| 191 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); | 189 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); |
| 192 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); | 190 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); |
| 193 } | 191 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 212 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); | 210 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); |
| 213 | 211 |
| 214 function callback() | 212 function callback() |
| 215 { | 213 { |
| 216 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); | 214 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); |
| 217 InspectorTest.completeTest(); | 215 InspectorTest.completeTest(); |
| 218 } | 216 } |
| 219 }; | 217 }; |
| 220 | 218 |
| 221 }; | 219 }; |
| OLD | NEW |