Files
tubestation/docshell/test/navigation/test_bug1745638.html
Olli Pettay f71572e725 Bug 1745638, allow stopping session history load to an iframe, r=peterv
The previous version had two issues:
It revealed an issue in the old implementation which causes an assertion to fire.
There was also a problem with mDocumentRequest, so the new approach tries to be less clever
and just adds a new boolean member variable mCheckingSessionHistory,
which GetIsAttemptingToNavigate() then uses.

Differential Revision: https://phabricator.services.mozilla.com/D136041
2022-02-01 18:59:05 +00:00

41 lines
980 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>bug 1745638</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
// This test triggers an assertion in the old session history
// implementation.
SimpleTest.expectAssertions(0, 1);
SimpleTest.waitForExplicitFinish();
var testWindow;
var loadCount = 0;
function test() {
testWindow = window.open("file_bug1745638.html");
}
function pageLoaded() {
++loadCount;
is(testWindow.document.getElementById('testFrame').contentDocument.body.innerHTML,
"passed",
"Iframe's textual content should be 'passed'.");
if (loadCount == 1) {
testWindow.history.go(0);
} else {
testWindow.close();
SimpleTest.finish();
}
}
</script>
</head>
<body onload="test()">
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>
</body>
</html>