Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../fast/js/resources/js-test-pre.js"></script> | |
| 5 </head> | |
| 6 <body id="body"> | |
| 7 This content should not be exposed to AT when a modal dialog is open. | |
| 8 <div> | |
| 9 <input title="input" id="input" type="text"> | |
| 10 </div> | |
| 11 <dialog title="dialog" id="dialog">Howdy</dialog> | |
| 12 | |
| 13 <script> | |
| 14 description("This tests that inert elements are not in the AT tree."); | |
| 15 | |
| 16 function treeContainsText(node, text) { | |
| 17 if (node.stringValue.indexOf(text) > 0) | |
| 18 return true; | |
| 19 for (i = 0; i < node.childrenCount; i++) { | |
| 20 if (treeContainsText(node.childAtIndex(i), text)) | |
| 21 return true; | |
| 22 } | |
| 23 return false; | |
| 24 } | |
| 25 | |
| 26 if (window.accessibilityController) { | |
| 27 document.body.focus(); | |
| 28 webArea = accessibilityController.focusedElement; | |
| 29 | |
| 30 shouldBeNonNull("accessibilityController.accessibleElementById('input')"); | |
| 31 shouldBeTrue("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')"); | |
|
dmazzoni
2013/10/30 23:32:22
A simpler way to test this is accessibilityControl
falken
2013/10/31 02:27:40
I wanted to ensure it works for an anon child of b
| |
| 32 | |
| 33 document.querySelector('dialog').showModal(); | |
| 34 shouldBeNull("accessibilityController.accessibleElementById('input')"); | |
| 35 shouldBeFalse("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')"); | |
| 36 | |
| 37 document.querySelector('dialog').close(); | |
| 38 shouldBeNonNull("accessibilityController.accessibleElementById('input')"); | |
| 39 shouldBeTrue("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')"); | |
| 40 } | |
| 41 </script> | |
| 42 <script src="../fast/js/resources/js-test-post.js"></script> | |
| 43 </body> | |
| 44 </html> | |
| OLD | NEW |