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

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

Issue 341483004: [DevTools] Add desktop device presets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, test fix 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
« no previous file with comments | « no previous file | Source/devtools/front_end/ResponsiveDesignView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 };
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/ResponsiveDesignView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698