docshell/test/navigation/file_fragment_handling_during_load.html
author Olli Pettay <Olli.Pettay@helsinki.fi>
Sat, 01 Mar 2014 21:08:18 +0200
changeset 171730 cc271727af4852a8a8684f939a27ed7aab8d7dc5
parent 171727 20c705d00e7c48ff5c82558af56be53a1a8f7f4c
permissions -rw-r--r--
Bug 895557, follow the spec when doing fragment navigation during page loads, enable test

<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>