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

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

Issue 212103004: [DevTools] Show device screen size in DIPs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tests Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/devtools/front_end/OverridesSupport.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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 };
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/OverridesSupport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698