blob: c24efa31ab9b3f57a11490e90532a93231ea65ca [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
document.cookie = 'cookie=parent';
function log(msg) {
var line = document.createElement('div');
line.appendChild(document.createTextNode(msg));
document.getElementById('console').appendChild(line);
}
var testStarted = false;
function doTest() {
if (testStarted)
return;
testStarted = true;
frames[0].location = "javascript:" +
"window.myopen = function(i) { frames[i].document.open(); };" +
"window.mywrite = function(i, str) { frames[i].document.write(str); };" +
"window.mywriteln = function(i, str) { frames[i].document.writeln(str); };" +
"window.myclose = function(i) { frames[i].document.close(); };" +
"parent.log('Helpers loaded!\\n');" +
"parent.setTimeout('continueTest()', 10);";
}
function continueTest() {
log('--- Test begins ---\n');
log('* "about:blank"\n');
log('document.URL = ' + frames[0].frames[0].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[0].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[0].document.cookie + '\n');
log('* ""\n');
log('document.URL = ' + frames[0].frames[1].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[1].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[1].document.cookie + '\n');
log('--- After document.open() ---\n');
frames[0].myopen(0);
frames[0].myopen(1);
log('* "about:blank"\n');
log('document.URL = ' + frames[0].frames[0].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[0].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[0].document.cookie + '\n');
log('* ""\n');
log('document.URL = ' + frames[0].frames[1].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[1].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[1].document.cookie + '\n');
log('--- After document.close() ---\n');
frames[0].myclose(0);
frames[0].myclose(1);
log('* "about:blank"\n');
log('document.URL = ' + frames[0].frames[0].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[0].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[0].document.cookie + '\n');
log('* ""\n');
log('document.URL = ' + frames[0].frames[1].document.URL + '\n');
log('document.baseURI = ' + frames[0].frames[1].document.baseURI + '\n');
log('document.cookie = ' + frames[0].frames[1].document.cookie + '\n');
log('--- Test ends ---\n');
testRunner.notifyDone();
}
</script>
</head>
<body>
<iframe
onload="doTest()"
src="resources/iframe-with-about-blank-children.html">
</iframe>
<div id="console"></div>
</body>
</html>