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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-unobserved.html

Issue 2960263002: [DevTools] Move pixel tests from inspector-protocol to inspector (Closed)
Patch Set: rebased Created 3 years, 5 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/inspector-test.js"></script>
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 dump()
26 {
27 return {
28 w: window.innerWidth,
29 h: window.innerHeight,
30 l: document.documentElement.scrollLeft,
31 t: document.documentElement.scrollTop
32 };
33 }
34
35 function test()
36 {
37 InspectorTest.EmulationAgent.invoke_forceViewport({x: 200, y: 200, scale: 2. 0 }).then(overrideActive);
38
39 function overrideActive()
40 {
41 InspectorTest.RuntimeAgent.invoke_evaluate({expression: 'dump()', return ByValue: true}).then(gotResult);
42 }
43
44 function gotResult(result)
45 {
46 var values = result.result.value;
47 InspectorTest.addResult("innerWidth = " + values.w);
48 InspectorTest.addResult("innerHeight = " + values.h);
49 InspectorTest.addResult("scrollLeft = " + values.l);
50 InspectorTest.addResult("scrollTop = " + values.t);
51 InspectorTest.completeTest();
52 }
53 }
54 </script>
55
56 </head>
57 <body onload="runTest()">
58 <p>
59 Tests that a forced viewport does not change metrics that are observable by the page.
60 </p>
61 <div id="long"></div>
62 </body>
63 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698