2016-09-30 06:55:10 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
|
|
<title>Bug 1300461</title>
|
|
|
|
</head>
|
|
|
|
<!-- The empty unload handler is to prevent bfcache. -->
|
|
|
|
<body onload="test();" onunload="">
|
|
|
|
<script>
|
|
|
|
let Ci = SpecialPowers.Ci;
|
|
|
|
let webNav = SpecialPowers.wrap(window)
|
2018-08-01 20:07:11 +03:00
|
|
|
.docShell
|
|
|
|
.QueryInterface(Ci.nsIWebNavigation);
|
2016-09-30 06:55:10 +03:00
|
|
|
let shistory = webNav.sessionHistory;
|
|
|
|
function test() {
|
|
|
|
if (opener) {
|
|
|
|
opener.info("file_bug1300461_back.html");
|
2018-11-07 16:55:47 +03:00
|
|
|
opener.is(shistory.count, 2, "check history length");
|
|
|
|
opener.is(shistory.index, 1, "check history index");
|
|
|
|
opener.is(shistory.legacySHistory.requestedIndex, -1, "check requestedIndex");
|
|
|
|
opener.ok(webNav.canGoBack, "check canGoBack");
|
2016-09-30 06:55:10 +03:00
|
|
|
if (opener.testCount == 1) {
|
2018-11-07 16:55:47 +03:00
|
|
|
opener.info("replaceState to redirect.html");
|
|
|
|
window.history.replaceState({}, "", "file_bug1300461_redirect.html");
|
2016-09-30 06:55:10 +03:00
|
|
|
}
|
|
|
|
window.history.back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|