summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_disallow_doubletap_zoom_inside_oopif.html
blob: 2c83cb1a1ff715f6159c72002a911f3fc761fca9 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="user-scalable=no"/>
  <title>Check that double tapping inside an oop iframe doesn't work if the top
         level content document doesn't allow zooming</title>
  <script src="apz_test_native_event_utils.js"></script>
  <script src="apz_test_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script>

async function test() {
  let useTouchpad = (location.search == "?touchpad");

  let resolution = await getResolution();
  ok(resolution > 0,
     "The initial_resolution is " + resolution + ", which is some sane value");

  // Set up a Promise waiting for a TransformEnd which should never happen.
  promiseTransformEnd().then(() => {
    ok(false, "No TransformEnd should happen!");
  });

  // A double tap inside the OOP iframe.
  await synthesizeDoubleTap(document.getElementById("target"), 20, 20, useTouchpad);

  for (let i = 0; i < 10; i++) {
    await promiseFrame();
  }

  // Flush state just in case.
  await promiseApzFlushedRepaints();

  let prev_resolution = resolution;
  resolution = await getResolution();
  is(resolution, prev_resolution, "No zoom should happen");
}

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

  </script>
<style>
iframe {
  margin: 0;
  padding: 0;
  border: 1px solid black;
}
</style>
</head>
<body>

<iframe id="target" width="100" height="100" src="http://example.org/"></iframe>

</body>
</html>