4 <title>Viewport: Scale
</title>
6 <meta name=
"viewport" content=
"width=device-width, minimum-scale=1">
7 <script src=
"/resources/testharness.js"></script>
8 <script src=
"/resources/testharnessreport.js"></script>
9 <script src=
"viewport_support.js"></script>
11 setup({explicit_done
: true, explicit_timeout
: true});
15 <h1>Viewport: Scale
</h1>
16 <h4>Test Description: Tests the visualViewport.scale property
</h4>
17 <h2 style=
"color: red">THIS IS A MANUAL TEST
</h2>
19 <button id=
"skipbtn" onclick=
"skipManualTest();">Skip Test
</button>
21 <p id=
"instruction"></p>
22 <button id=
"continue">Start Test
</button>
24 <div id=
"spacer"></div>
27 var continueBtn
= document
.getElementById("continue");
29 function continueTest() {
30 nextStep(function(instructionText
) {
31 var instruction
= document
.getElementById("instruction");
32 continueBtn
.innerText
= "Continue";
33 instruction
.innerText
= instructionText
;
37 continueBtn
.addEventListener('click', continueTest
);
42 '1. Ensure the browser is at the default pinch and browser zoom ' +
43 'levels (100%). Most browsers: ctrl+0');
46 showPinchWidget
.bind(null, 2.0, 0, 0, continueTest
),
48 '2.Follow instructions on pinch zoom dialog.');
52 // Ensure we zoomed in to about what we expect.
53 assert_approx_equals(window
.visualViewport
.scale
, 2.0, 0.2,
54 "window.visualViewport.scale reflects pinch-zoom level");
56 'With ~200% pinch-zoom',
57 '3. Pinch-zoom back out to the minimum scale');
61 assert_equals(window
.visualViewport
.scale
, 1);
63 'Fully pinch-zoomed out',
64 '4. If your browser supports it, browser-zoom in (using ctrl-+). ' +
65 'Otherwise just click continue.');
69 assert_equals(window
.visualViewport
.scale
, 1);
71 'Browser zoom doesn\'t change visualViewport.scale',
72 '5. Reset browser zoom to default (ctrl-0)');