Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / loading-iframe-updates-axtree.html
blob141d67ef19638bfed97ecd492df2a2204f3801ed
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
5 <script>
6 if (window.testRunner)
7 testRunner.waitUntilDone();
9 function runTest()
11 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.");
13 if (window.accessibilityController) {
14 window.iframe = accessibilityController.accessibleElementById('iframe');
15 window.scrollarea = iframe.childAtIndex(0);
16 window.subwebarea = scrollarea.childAtIndex(0);
19 window.iframeElement = document.getElementById("iframe");
20 iframeElement.addEventListener("load", function() {
21 if (window.accessibilityController) {
22 window.newIframe = accessibilityController.accessibleElementById('iframe');
23 window.newScrollarea = newIframe.childAtIndex(0);
24 window.newSubwebarea = newScrollarea.childAtIndex(0);
26 shouldBeTrue("iframe.isEqual(newIframe)");
27 shouldBeFalse("scrollarea.isEqual(newScrollarea)");
28 shouldBeFalse("subwebarea.isEqual(newSubwebarea)");
29 shouldBeTrue("newSubwebarea.childrenCount > 0");
32 debug('<br /><span class="pass">TEST COMPLETE</span>');
33 if (window.testRunner)
34 testRunner.notifyDone();
35 }, false);
37 // Load content into the iframe. This will trigger the event
38 // handler above, which will check that the accessibility tree
39 // was updated with new content.
40 window.iframeElement.src = "data:text/html,<body><button>Click me</button></body>";
44 window.addEventListener('load', function() {
45 runTest();
46 }, false);
48 </script>
49 </head>
50 <body>
52 <p>Before</p>
54 <iframe id="iframe" role="group"></iframe>
56 <p>After</p>
58 <p>End of test</p>
60 <p id="description"></p>
61 <div id="console"></div>
63 </body>
64 </html>