summaryrefslogtreecommitdiffstats
path: root/docshell/test/navigation/file_fragment_handling_during_load.html
blob: fbfa0cb384a5bc8e1402d265b91b7cfa72612ddb (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
<html>
  <head>
    <script>
      var timerID = 0;
      function testDone() {
        clearTimeout(timerID);
        var l = document.body.firstChild.contentWindow.location.href;
        opener.is(l, "data:text/html,bar", "Should have loaded a new document");
        opener.nextTest();
        window.close();
      }
      function test() {
        var ifr = document.getElementsByTagName("iframe")[0];
        ifr.onload = testDone;
        ifr.contentWindow.location.hash = "b";
        ifr.contentWindow.location.href = "data:text/html,bar";
        history.back();
        timerID = setTimeout(testDone, 2000);
      }
    </script>
  </head>
  <body onload="setTimeout(test, 0)"><iframe src="data:text/html,foo#a"></iframe>
  </body>
</html>