OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../resources/js-test.js"></script> | 3 <script src="../resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 | 6 |
7 <p>Before</p> | 7 <p>Before</p> |
8 | 8 |
9 <iframe id="iframe" title="InnerFrame"></iframe> | 9 <iframe id="iframe" title="InnerFrame"></iframe> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 if (window.accessibilityController) { | 30 if (window.accessibilityController) { |
31 // Initially, the iframe should not be loaded, so we shouldn't be ab
le to find this button. | 31 // Initially, the iframe should not be loaded, so we shouldn't be ab
le to find this button. |
32 shouldBeUndefined("accessibilityController.accessibleElementById('in
nerbutton')"); | 32 shouldBeUndefined("accessibilityController.accessibleElementById('in
nerbutton')"); |
33 | 33 |
34 window.accessibilityController.addNotificationListener(function (tar
get, notification) { | 34 window.accessibilityController.addNotificationListener(function (tar
get, notification) { |
35 if (!target.parentElement() || !target.parentElement().parentEle
ment()) | 35 if (!target.parentElement() || !target.parentElement().parentEle
ment()) |
36 return; | 36 return; |
37 | 37 |
38 // Ignore this notification if it's not within the subtree of th
e iframe. | 38 // Ignore this notification if it's not within the subtree of th
e iframe. |
39 var frameTarget = target.parentElement().parentElement(); | 39 var frameTarget = target.parentElement().parentElement(); |
40 if (frameTarget.deprecatedDescription.indexOf("InnerFrame") == -
1) | 40 if (frameTarget.name.indexOf("InnerFrame") == -1) |
41 return; | 41 return; |
42 | 42 |
43 // Even still we'll get LayoutComplete notifications sooner than
we want. | 43 // Even still we'll get LayoutComplete notifications sooner than
we want. |
44 if (!accessibilityController.accessibleElementById('innerbutton'
)) | 44 if (!accessibilityController.accessibleElementById('innerbutton'
)) |
45 return; | 45 return; |
46 | 46 |
47 // Check that the button within the iframe is now reachable from
the root. | 47 // Check that the button within the iframe is now reachable from
the root. |
48 shouldBeDefined("accessibilityController.accessibleElementById('
innerbutton')"); | 48 shouldBeDefined("accessibilityController.accessibleElementById('
innerbutton')"); |
49 if (window.accessibilityController) | 49 if (window.accessibilityController) |
50 accessibilityController.removeNotificationListener(); | 50 accessibilityController.removeNotificationListener(); |
51 | 51 |
52 finishJSTest(); | 52 finishJSTest(); |
53 }); | 53 }); |
54 } | 54 } |
55 | 55 |
56 // Load content into the iframe. This will trigger the event | 56 // Load content into the iframe. This will trigger the event |
57 // handler above, which will check that the accessibility tree | 57 // handler above, which will check that the accessibility tree |
58 // was updated with new content. | 58 // was updated with new content. |
59 document.getElementById("iframe").src = "data:text/html,<body><button id
='innerbutton'>InnerButton</button></body>"; | 59 document.getElementById("iframe").src = "data:text/html,<body><button id
='innerbutton'>InnerButton</button></body>"; |
60 } | 60 } |
61 window.addEventListener('load', runTest); | 61 window.addEventListener('load', runTest); |
62 </script> | 62 </script> |
63 | 63 |
64 </body> | 64 </body> |
65 </html> | 65 </html> |
OLD | NEW |