summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/soft-navigation-heuristics/navigate-child.html
blob: e3c17e2dbaa2148b0dd35632d0651592f9696bec (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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Navigate a child window.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/soft-navigation-helper.js"></script>
</head>
<body>
  <main id=main>
  <a href="empty.html?2" rel=opener target=child id=link>Click me!</a>
  </main>
  <script>
    promise_test(async t => {
      const child = window.open("resources/empty.html?1", "child");
      while (!child.document) {
        await new Promise(r => t.step_timeout(r, 10));
      }
      const link = document.getElementById("link");
      interact(link);
      while (!child.location.href.includes("2")) {
        await new Promise(r => t.step_timeout(r, 10));
      }
    }, "Test that a navigated child window doesn't crash");
  </script>
</body>
</html>