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

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

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync. Created 4 years, 3 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
OLDNEW
1 function setMetaViewport(override) 1 function setMetaViewport(override)
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS caleFactor, viewport, insets, noReload, callback) 197 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS caleFactor, viewport, insets, noReload, callback)
198 { 198 {
199 if (enabled) { 199 if (enabled) {
200 var params = {}; 200 var params = {};
201 params.width = width; 201 params.width = width;
202 params.height = height; 202 params.height = height;
203 params.deviceScaleFactor = deviceScaleFactor; 203 params.deviceScaleFactor = deviceScaleFactor;
204 params.mobile = true; 204 params.mobile = true;
205 params.fitWindow = false; 205 params.fitWindow = false;
206 params.scale = 1;
dgozman 2016/08/29 20:45:36 Please revert.
Eric Seckler 2016/09/12 13:58:00 Done.
207 params.screenWidth = width; 206 params.screenWidth = width;
208 params.screenHeight = height; 207 params.screenHeight = height;
209 params.positionX = 0; 208 params.positionX = 0;
210 params.positionY = 0; 209 params.positionY = 0;
211 if (insets) { 210 if (insets) {
212 params.screenWidth += insets.left + insets.right; 211 params.screenWidth += insets.left + insets.right;
213 params.positionX = insets.left; 212 params.positionX = insets.left;
214 params.screenHeight += insets.top + insets.bottom; 213 params.screenHeight += insets.top + insets.bottom;
215 params.positionY = insets.top; 214 params.positionY = insets.top;
216 } 215 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor t, insets, noReload, callback); 249 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor t, insets, noReload, callback);
251 250
252 function callback() 251 function callback()
253 { 252 {
254 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); 253 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n"));
255 InspectorTest.completeTest(); 254 InspectorTest.completeTest();
256 } 255 }
257 }; 256 };
258 257
259 }; 258 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698