summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_fission_empty.html
blob: 6a95f763393ca9887442d6e26b3708d975b71069 (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
<!DOCTYPE html>
<html id="fission_empty_docelement">
 <meta charset="utf-8">
 <style>
 html,body {
   /* Convenient for calculation of element positions */
   margin: 0;
   padding: 0;
 }
 </style>
 <script src="apz_test_utils.js"></script>
 <script src="/tests/SimpleTest/SimpleTest.js"></script>
 <script src="/tests/SimpleTest/paint_listener.js"></script>
 <script>
// This is an empty document that serves as a OOPIF content document that be
// reused by different fission subtests. The subtest can eval stuff in this
// document using the sendToOopif helper and thereby populate this document
// with whatever is needed. This allows the subtest to more "contained" in a
// single file and avoids having to create new dummy files for each subtest.
async function loaded() {
  window.dispatchEvent(new Event("FissionTestHelper:Init"));
  // Wait a couple of animation frames before sending the load, to ensure that
  // this OOPIF's layer tree has been sent to the compositor. We use this
  // instead of things like promiseOnlyApzControllerFlushed and/or promiseAllPaintsDone because
  // this page is running without SpecialPowers and I couldn't figure out a good
  // way to get a hold of a things like Services.obs or DOMWindowUtils easily.
  await promiseFrame();
  await promiseFrame();
  FissionTestHelper.fireEventInEmbedder("OOPIF:Load", {content: window.location.href});
}
 </script>
 <body onload="loaded()">
 </body>
</html>