Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / textarea-selected-text-range.html
1 <html>
2 <script src="../resources/js-test-pre.js"></script>
3 <body>
4     
5     <div id="result"></div>
6     
7     <textarea name="area1" id="area1" rows="5" cols="40">
8 line 1
9 line 2
10 line 3
11     </textarea>
12
13     <script>
14         if (window.accessibilityController) {
15             window.jsTestIsAsync = true;
16             var area1 = document.getElementById("area1");
17             area1.focus();
18
19             var textArea = accessibilityController.focusedElement;
20
21             textArea.setSelectedTextRange(4,0);
22
23             // After setting a property through accessibility, the value won't be updated immediately, so we
24             // must check after a timeout to re-verify the value.
25             shouldBecomeEqual("textArea.selectedTextRange", "'{4, 0}'", function() {
26                 textArea.setSelectedTextRange(8,2);
27                 shouldBecomeEqual("textArea.selectedTextRange", "'{8, 2}'", function() {
28                     textArea.setSelectedTextRange(100,0);
29                     shouldBecomeEqual("textArea.selectedTextRange", "'{25, 0}'", finishJSTest);
30                 });
31             });
32         }
33     </script>
34 <script src="../resources/js-test-post.js"></script>
35 </body>
36 </html>