| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 | |
| 4 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 5 <script src="../../http/tests/inspector/elements-test.js"></script> | |
| 6 <script src="device-emulation-test.js"></script> | |
| 7 | |
| 8 <script> | |
| 9 // This test is based on http://jsbin.com/urowoh/latest. | |
| 10 setMetaViewport(); | |
| 11 </script> | |
| 12 | |
| 13 <style> | |
| 14 html { | |
| 15 overflow-x: hidden; | |
| 16 } | |
| 17 | |
| 18 body { | |
| 19 margin: 0; | |
| 20 min-height: 1000px; | |
| 21 overflow-x: hidden; | |
| 22 } | |
| 23 </style> | |
| 24 | |
| 25 <script> | |
| 26 function test() | |
| 27 { | |
| 28 // 980px viewport loaded into a 490x320 screen should load at 0.5 scale. | |
| 29 InspectorTest.testDeviceEmulation("device-emulation-initial-scale.html", 490
, 320, 3, "w=980"); | |
| 30 } | |
| 31 </script> | |
| 32 | |
| 33 </head> | |
| 34 <body onload="runTest()"> | |
| 35 <p> | |
| 36 Tests that turning on device emulation with a non-1 device pixel ratio sets the | |
| 37 appropriate initial scale. Page scale is reflected by the innerWidth and | |
| 38 innerHeight properties. Since the layout width is set to 980 (in the viewport | |
| 39 meta tag), and the emulated viewport width is 490 px, the initial scale should | |
| 40 be 490/980 = 0.5. i.e. innerWidth=980 innerHeight=640. | |
| 41 </p> | |
| 42 </body> | |
| 43 </html> | |
| OLD | NEW |