Bug 978408 - A test for fragment navigation during load, r=nsm

--HG--
extra : rebase_source : c464b4b51a10d6c22817bf5125935e3c0016c6bc
This commit is contained in:
Olli Pettay 2014-03-01 20:11:30 +02:00
parent 4bd0419c77
commit 6034a38a6c
3 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,24 @@
<html>
<head>
<script>
var timerID = 0;
function testDone() {
clearTimeout(timerID);
var l = document.body.firstChild.contentWindow.location.href;
opener.todo_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>

View File

@ -8,6 +8,7 @@ support-files =
file_bug508537_1.html
file_bug534178.html
file_document_write_1.html
file_fragment_handling_during_load.html
file_static_and_dynamic_1.html
frame0.html
frame1.html

View File

@ -26,7 +26,8 @@ var testFiles =
"file_bug508537_1.html", // Dynamic frames and forward-back
"file_document_write_1.html", // Session history + document.write
"file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
"file_bug534178.html" // Session history transaction clean-up.
"file_bug534178.html", // Session history transaction clean-up.
"file_fragment_handling_during_load.html"
];
var testCount = 0; // Used by the test files.