| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/accessibility-helper.js"></script> |
| <script src="../../resources/js-test.js"></script> |
| </head> |
| <body> |
| |
| Foo <span id="span-one">bar baz</span> |
| One <span id="span-two">two three</span> |
| |
| <script> |
| var output = "This test ensures we update the accessibility tree when selected text changes dynamically.\n\n"; |
| |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| |
| var webArea = accessibilityController.rootElement.childAtIndex(0); |
| var selectedRange; |
| setTimeout(async function() { |
| selectedRange = await selectElementTextById("span-one", webArea); |
| output += expect("webArea.stringForTextMarkerRange(selectedRange)", "'bar baz'"); |
| |
| selectedRange = await selectElementTextById("span-two", webArea); |
| output += expect("webArea.stringForTextMarkerRange(selectedRange)", "'two three'"); |
| |
| debug(output); |
| finishJSTest(); |
| }, 0); |
| } |
| </script> |
| </body> |
| </html> |
| |