summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_zoom_with_dynamic_toolbar.html
blob: 261bca137754c694d3062d9ed7f8d1ee2d5cbf9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Zooming out to the initial scale with the dynamic toolbar</title>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>

  <style>
    html,body {
      height: 100%;
      margin: 0;
      padding: 0;
    }
  </style>

  <script type="application/javascript">

async function test() {
  ok(window.visualViewport.scale > 1.0,
     "The scale value should be greater than 1.0");

  // Do a pinch-zoom out to restore the initial scale.
  await pinchZoomOutWithTouchAtCenter();
  await promiseApzFlushedRepaints();

  is(visualViewport.scale, 1.0,
     "The initial scale value should be restored to 1.0");
}

SpecialPowers.getDOMWindowUtils(window).setDynamicToolbarMaxHeight(100);
SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(1.1)

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);

  </script>
</head>
<body>
</body>
</html>