summaryrefslogtreecommitdiffstats
path: root/layout/generic/crashtests/1881375-1.html
blob: 8cef2604339cb67755d67876071e758541ffb14b (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
<!DOCTYPE html>
<html class="reftest-wait">
<script>
// Loop count for the handler below. This value seems to be enough for the
// crashtest to be likely to trigger the crash.
const MAX_LOADS = 3;
let loadCount = 0;

// Handler which gets invoked by the iframe whenever it completes a load
// (and dynamically reloads itself). This lets us allow the testcase to
// reload over and over (as seems to be required to trigger the crash),
// while also keeping the test duration reasonably bounded.
window.addEventListener(
  "message",
  (event) => {
    if (loadCount++ == MAX_LOADS) {
      // After MAX_LOADS reloads of the iframe, call ourselves done.
      myIframe.remove();
      document.documentElement.className = "";
    }
  }
);

</script>
<iframe id="myIframe" src="1881375-1-helper.html"></iframe>