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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-reset.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
1 <html> 1 <html>
2 <head> 2 <head>
3 3
4 <script src="../../http/tests/inspector-protocol/resources/inspector-protocol-te st.js"></script> 4 <script src="../../http/tests/inspector/inspector-test.js"></script>
5 5
6 <style> 6 <style>
7 html { 7 html {
8 overflow: hidden; 8 overflow: hidden;
9 } 9 }
10 10
11 body { 11 body {
12 margin: 0; 12 margin: 0;
13 min-height: 1000px; 13 min-height: 1000px;
14 overflow: hidden; 14 overflow: hidden;
(...skipping 14 matching lines...) Expand all
29 top: 9000px; 29 top: 9000px;
30 width: 100px; 30 width: 100px;
31 height: 100px; 31 height: 100px;
32 background-color: green; 32 background-color: green;
33 } 33 }
34 </style> 34 </style>
35 35
36 <script> 36 <script>
37 function test() 37 function test()
38 { 38 {
39 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testRunner.du mpAsTextWithPixelResults();"} ); 39 InspectorTest.evaluateInPage("testRunner.dumpAsTextWithPixelResults();", () => {
40 40 InspectorTest.EmulationAgent.invoke_forceViewport({x: 200, y: 9000, scal e: 2.0}).then(overrideActive);
41 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 200, "y": 9000, "scale": 2.0 }, overrideActive); 41 });
42 42
43 function overrideActive() 43 function overrideActive()
44 { 44 {
45 InspectorTest.sendCommand("Emulation.resetViewport", {}, overrideCleared ); 45 InspectorTest.EmulationAgent.invoke_resetViewport({}).then(overrideClear ed);
46 } 46 }
47 47
48 function overrideCleared() 48 function overrideCleared()
49 { 49 {
50 // Complete the test without closing the inspector, so that the override stays active for the picture. 50 // Complete the test without closing the inspector, so that the override stays active for the picture.
51 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testRunne r.notifyDone();"} ); 51 InspectorTest.flushResults();
52 InspectorTest.evaluateInPage("testRunner.notifyDone();");
52 } 53 }
53 } 54 }
54 </script> 55 </script>
55 56
56 </head> 57 </head>
57 <body onload="runTest()"> 58 <body onload="runTest()">
58 <p> 59 <p>
59 Tests that resetting an earlier forced viewport restores the viewport back to or iginal area. 60 Tests that resetting an earlier forced viewport restores the viewport back to or iginal area.
60 </p> 61 </p>
61 <div id="near"></div> 62 <div id="near"></div>
62 <div id="far"></div> 63 <div id="far"></div>
63 </body> 64 </body>
64 </html> 65 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698