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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/emulation/forced-viewport-unobserved.html

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adress Dmitry's comments + sync. Created 4 years, 2 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
(Empty)
1 <html>
2 <head>
3
4 <script src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></s cript>
5
6 <style>
7 html {
8 overflow: hidden;
9 }
10
11 body {
12 margin: 0;
13 min-height: 1000px;
14 overflow: hidden;
15 }
16
17 #long {
18 height: 2000px;
19 width: 100px;
20 background-color: green;
21 }
22 </style>
23
24 <script>
25 function test()
26 {
27 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 200, "y": 200, " scale": 2.0 }, overrideActive);
28
29 function overrideActive()
30 {
31 InspectorTest.log("innerWidth = " + window.innerWidth);
32 InspectorTest.log("innerHeight = " + window.innerHeight);
33 InspectorTest.log("scrollLeft = " + document.scrollingElement.scrollLeft );
34 InspectorTest.log("scrollTop = " + document.scrollingElement.scrollTop);
35 InspectorTest.completeTest();
36 }
37 }
38 </script>
39
40 </head>
41 <body onload="runTest()">
42 <p>
43 Tests that a forced viewport does not change metrics that are observable by the page.
44 </p>
45 <div id="long"></div>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698