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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 InspectorTest.getPageMetrics = function(full, callback) | 183 InspectorTest.getPageMetrics = function(full, callback) |
184 { | 184 { |
185 InspectorTest.evaluateInPage("dumpMetrics(" + full + ")", callback); | 185 InspectorTest.evaluateInPage("dumpMetrics(" + full + ")", callback); |
186 } | 186 } |
187 | 187 |
188 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS
caleFactor, viewport, callback) | 188 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS
caleFactor, viewport, callback) |
189 { | 189 { |
190 InspectorTest.addSniffer(WebInspector.overridesSupport, "_deviceMetricsOverr
ideAppliedForTest", emulateCallback); | 190 InspectorTest.addSniffer(WebInspector.overridesSupport, "_deviceMetricsOverr
ideAppliedForTest", emulateCallback); |
191 if (enabled) | 191 if (enabled) |
192 WebInspector.overridesSupport.emulateDevice(width + "x" + height + "x" +
deviceScaleFactor + "x0x0", ""); | 192 WebInspector.overridesSupport.emulateDevice(new WebInspector.OverridesSu
pport.Device(width + "x" + height + "x" + deviceScaleFactor + "x1x1", "")); |
193 else | 193 else |
194 WebInspector.overridesSupport.reset(); | 194 WebInspector.overridesSupport.reset(); |
195 | 195 |
196 function emulateCallback() | 196 function emulateCallback() |
197 { | 197 { |
198 var warning = WebInspector.overridesSupport.warningMessage(); | 198 var warning = WebInspector.overridesSupport.warningMessage(); |
199 if (warning) | 199 if (warning) |
200 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); | 200 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); |
201 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); | 201 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); |
202 } | 202 } |
(...skipping 19 matching lines...) Expand all Loading... |
222 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); | 222 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); |
223 | 223 |
224 function callback() | 224 function callback() |
225 { | 225 { |
226 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); | 226 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); |
227 InspectorTest.completeTest(); | 227 InspectorTest.completeTest(); |
228 } | 228 } |
229 }; | 229 }; |
230 | 230 |
231 }; | 231 }; |
OLD | NEW |