blob: 2470d59430bbaeb7b788c2fe3df90020e768e0e3 [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); undefined;";
}
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>