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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/device-mode/forced-viewport-near.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: 100, y: 100, scale : 1.0}).then(firstOverrideActive);
41 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 100, "y": 100, " scale": 1.0 }, firstOverrideActive); 41 });
42 42
43 function firstOverrideActive() 43 function firstOverrideActive()
44 { 44 {
45 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 200, "y": 20 0, "scale": 2.0 }, secondOverrideActive); 45 InspectorTest.EmulationAgent.invoke_forceViewport({x: 200, y: 200, scale : 2.0}).then(secondOverrideActive);
46 } 46 }
47 47
48 function secondOverrideActive() 48 function secondOverrideActive()
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 a forced viewport repositions and scales an element that lies inside the normal painting area. Also verifies that applying a subsequent forced viewpo rt updates an prior one. 60 Tests that a forced viewport repositions and scales an element that lies inside the normal painting area. Also verifies that applying a subsequent forced viewpo rt updates an prior one.
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