blob: 8f7da17d49674ae1f6b4d848aa8407f6454e41db [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<p id="description"></p>
<pre id="console"></pre>
var jsTestIsAsync = true;
description('Tests that appending iframe with with no URL and setting its URL later (including hash part) does not overwrite current history entry.');
if (window.testRunner)
onload = beginTest;
function beginTest() {
// The frame must be appened both on initial load and after navigating
// back. On first load we must set the same SRC as after navigating away.
var iframe = document.createElement('iframe');
if (location.hash.indexOf('wentBack') == -1) {
// Run else code path after going back.
location.hash = 'wentBack';
// Navigate forward and back to create forward navigation entry.
// Must be done outside the load handler to generate history entry.
window.setTimeout(function() {
location.href = 'resources/back-on-load.html';
}, 0);
} else {
window.setTimeout(setFrameSrcAndfinishTest, 100);
function setFrameSrc() {
document.querySelector('iframe').src = 'about:blank/#identifier';
function setFrameSrcAndfinishTest() {
document.querySelector('iframe').src = 'about:blank/#identifier';