blob: 37ac1a77dd40b13e4f1b0b05b579e96ef09937e9 [file] [log] [blame]
<html>
<head>
<script src="../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;
function runTest()
{
description("This tests that if an iframe loads new content after its accessibility object has already been accessed, the iframe accessibility object's descendants are the new scroll area and web area, not the old deleted ones.");
if (window.accessibilityController) {
window.iframe = accessibilityController.accessibleElementById('iframeContainer');
window.scrollarea = iframe.childAtIndex(0);
window.subwebarea = scrollarea.childAtIndex(0);
}
window.iframeElement = document.getElementById("iframe");
iframeElement.addEventListener("load", function() {
if (window.accessibilityController) {
window.newIframe = accessibilityController.accessibleElementById('iframeContainer');
window.newScrollarea = newIframe.childAtIndex(0);
window.newSubwebarea = newScrollarea.childAtIndex(0);
// for WK1, the scroll area does not change
var iframeEqual = iframe.isEqual(newIframe);
var scrollareaEqual = scrollarea.isEqual(newScrollarea);
var subwebareaEqual = subwebarea.isEqual(newSubwebarea);
debug("iframe.isEqual(newIframe): " + iframeEqual);
debug("scrollarea.isEqual(newScrollarea): " + scrollareaEqual);
debug("subwebarea.isEqual(newSubwebarea): " + subwebareaEqual);
shouldBeTrue("newSubwebarea.childrenCount > 0");
}
finishJSTest();
}, false);
// Load content into the iframe. This will trigger the event
// handler above, which will check that the accessibility tree
// was updated with new content.
window.iframeElement.src = "data:text/html,<body><button>Click me</button></body>";
}
window.addEventListener('load', function() {
setTimeout(runTest, 10);
}, false);
</script>
</head>
<body>
<p>Before</p>
<div id="iframeContainer">
<iframe id="iframe"></iframe>
</div>
<p>After</p>
<p>End of test</p>
<p id="description"></p>
<div id="console"></div>
</body>
</html>