Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / loading-iframe-updates-axtree.html
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4
5   <script>
6     jsTestIsAsync = true;
7
8     function runTest()
9     {
10         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.");
11
12         if (window.accessibilityController) {
13             window.iframe = accessibilityController.accessibleElementById('iframeContainer');
14             window.scrollarea = iframe.childAtIndex(0);
15             window.subwebarea = scrollarea.childAtIndex(0);
16         }
17
18         window.iframeElement = document.getElementById("iframe");
19         iframeElement.addEventListener("load", function() {
20             if (window.accessibilityController) {
21                 window.newIframe = accessibilityController.accessibleElementById('iframeContainer');
22                 window.newScrollarea = newIframe.childAtIndex(0);
23                 window.newSubwebarea = newScrollarea.childAtIndex(0);
24
25                 // for WK1, the scroll area does not change
26                 var iframeEqual = iframe.isEqual(newIframe);
27                 var scrollareaEqual = scrollarea.isEqual(newScrollarea);
28                 var subwebareaEqual = subwebarea.isEqual(newSubwebarea);
29                 debug("iframe.isEqual(newIframe): " + iframeEqual);
30                 debug("scrollarea.isEqual(newScrollarea): " + scrollareaEqual);
31                 debug("subwebarea.isEqual(newSubwebarea): " + subwebareaEqual);
32                 shouldBeTrue("newSubwebarea.childrenCount > 0");
33             }
34
35             finishJSTest();
36         }, false);
37
38         // Load content into the iframe. This will trigger the event
39         // handler above, which will check that the accessibility tree
40         // was updated with new content.
41         window.iframeElement.src = "data:text/html,<body><button>Click me</button></body>";
42
43     }
44
45     window.addEventListener('load', function() {
46         setTimeout(runTest, 10);
47     }, false);
48
49   </script>
50 </head>
51 <body>
52
53 <p>Before</p>
54
55 <div id="iframeContainer">
56 <iframe id="iframe"></iframe>
57 </div>
58
59 <p>After</p>
60
61 <p>End of test</p>
62
63 <p id="description"></p>
64 <div id="console"></div>
65
66 </body>
67 </html>