summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html
blob: c2c31e76f4530072b790bc6df8b60a518ef795e8 (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>
<title>Traverse the history after document.write after the load event</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
  var t = async_test();
  started = false;
  pages = []
  start_test_wait = t.step_func(
    function() {
      check_result = t.step_func(
        function() {
          if (pages.length < 4) {
              setTimeout(check_result, 500);
              return
          }
          //The pass condition here is based on the idea that the spec is wrong and browsers are right
          assert_array_equals(pages, [2, 3, 2, 3], "Pages opened during history navigation");
          t.done();
        }
      )
      setTimeout(check_result, 500);
    }
  );
  t.step(function() {
    win = window.open("history_entry.html?urls=traverse_the_history_write_after_load_1-1.html");
    t.add_cleanup(function() {win.close()});
});
</script>