summaryrefslogtreecommitdiffstats
path: root/docshell/test/navigation/file_bug1379762-1.html
blob: e8cd8b30b49f56830b0255a678607ed5ee729af8 (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
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bug 1379762</title>
  </head>
  <img srcset> <!-- This tries to add load blockers during bfcache restoration -->
  <script>
    onunload = null; // enable bfcache
    opener.is(opener.testCount, 0,
              "We should only run once; otherwise the loadCount variable makes no sense");
    var loadCount = 0;
    onpageshow = function() {
      ++opener.testCount;
      if (opener.testCount == 1) {
        // Navigate forward and then back.
        setTimeout(function() { location = "goback.html"; }, 0);
      } else if (opener.testCount == 2) {
        // Do this async so our load event gets a chance to fire if it plans to
        // do it.
        setTimeout(function() {
          opener.nextTest();
          window.close();
        });
      }
    };
    onload = function() {
      ++loadCount;
      opener.is(loadCount, 1, "Should only get one onload");
    }
  </script>
</html>