blob: 3ab59385d39290017523d7a63950be384f07a4f1 [file] [log] [blame]
<script>
function addFrames() {
var parent = document.createElement('iframe');
parent.id = 'theframe';
document.body.appendChild(parent);
for (i = 0; i < 150; i++) {
var frame = document.createElement("iframe");
frame.setAttribute("src", "data:text/plain," + i);
frame.style.display = 'none';
parent.contentDocument.body.appendChild(frame);
}
}
function runTest() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
// Add 150 frames.
addFrames();
// Remove the parent frame
var parent = document.getElementById('theframe');
parent.parentNode.removeChild(parent);
// Add 150 frames again.
addFrames();
var parent = document.getElementById('theframe');
if (parent.contentWindow.frames.length != 150)
return;
document.getElementById('result').innerHTML = 'SUCCESS';
}
</script>
<body onload="runTest()">
<div>This tests that frames are properly deregistered with the page's counter when removed. If this test is successful, the text "SUCCESS" will be shown below.</div>
<div id="result">FAILURE</div>
</body>