pjs/docshell/test/test_bug615501_2.html

57 строки
1.4 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=615501
-->
<head>
<title>Test for Bug 615501</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=615501">Mozilla Bug 615501</a>
<iframe id='iframe' src='file_bug615501.html'></iframe>
<script type="application/javascript;version=1.7">
/** Test for Bug 615501 **/
// This is the same as test_bug615501_1.html, except it calls replaceState
// instead of pushState.
SimpleTest.waitForExplicitFinish();
// Called by inner frame on DOMContentLoaded.
function innerDOMContentLoaded() {
ok(true, "Got DOMContentLoaded event.");
$('iframe').contentWindow.history.replaceState('', '', '');
}
// Called by inner frame on load.
function innerLoad() {
ok(true, "Got load event.");
// Spin the event loop a few times to give popstate a chance to fire, then
// declare that we're done.
setTimeout(function(count) {
if (count > 0) {
setTimeout(arguments.callee, 0, count-1);
}
else {
SimpleTest.finish();
}
}, 0, 10);
}
// Called by inner frame on popstate.
function innerPopstate() {
ok(false, "Shouldn't get a popstate.");
}
</script>
</body>
</html>