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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(new WebInspector.OverridesSu
pport.Device(width + "x" + height + "x" + deviceScaleFactor + "x1x1", "")); | 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 WebInspector.overridesSupport.settings.emulationEnabled.set(enabled); |
195 | 196 |
196 function emulateCallback() | 197 function emulateCallback() |
197 { | 198 { |
198 var warning = WebInspector.overridesSupport.warningMessage(); | 199 var warning = WebInspector.overridesSupport.warningMessage(); |
199 if (warning) | 200 if (warning) |
200 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); | 201 InspectorTest._deviceEmulationResults.push("Emulation warning: " + w
arning); |
201 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); | 202 InspectorTest.navigate(InspectorTest._deviceEmulationPageUrl + "?" + vie
wport, callback); |
202 } | 203 } |
203 }; | 204 }; |
204 | 205 |
(...skipping 17 matching lines...) Expand all Loading... |
222 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); | 223 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor
t, callback); |
223 | 224 |
224 function callback() | 225 function callback() |
225 { | 226 { |
226 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); | 227 InspectorTest.addResult(InspectorTest._deviceEmulationResults.join("\n")
); |
227 InspectorTest.completeTest(); | 228 InspectorTest.completeTest(); |
228 } | 229 } |
229 }; | 230 }; |
230 | 231 |
231 }; | 232 }; |
OLD | NEW |