Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: LayoutTests/inspector/device-emulation/device-emulation-test.js

Issue 340723005: [DevTools] Remove unnecessary emulation checkboxes and simplify UX. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698