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