OLD | NEW |
(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 #near { |
| 18 position: absolute; |
| 19 left: 200px; |
| 20 top: 200px; |
| 21 width: 100px; |
| 22 height: 100px; |
| 23 background-color: red; |
| 24 } |
| 25 |
| 26 #far { |
| 27 position: absolute; |
| 28 left: 200px; |
| 29 top: 9000px; |
| 30 width: 100px; |
| 31 height: 100px; |
| 32 background-color: green; |
| 33 } |
| 34 </style> |
| 35 |
| 36 <script> |
| 37 function test() |
| 38 { |
| 39 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testRunner.du
mpAsTextWithPixelResults();"} ); |
| 40 |
| 41 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 100, "y": 100, "
scale": 1.0 }, firstOverrideActive); |
| 42 |
| 43 function firstOverrideActive() |
| 44 { |
| 45 InspectorTest.sendCommand("Emulation.forceViewport", { "x": 200, "y": 20
0, "scale": 2.0 }, secondOverrideActive); |
| 46 } |
| 47 |
| 48 function secondOverrideActive() |
| 49 { |
| 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();"} ); |
| 52 } |
| 53 } |
| 54 </script> |
| 55 |
| 56 </head> |
| 57 <body onload="runTest()"> |
| 58 <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 </p> |
| 61 <div id="near"></div> |
| 62 <div id="far"></div> |
| 63 </body> |
| 64 </html> |
OLD | NEW |