Improve some LayoutTests/inspector flakey output for tests with InspectorTest.reloadPage
[WebKit-https.git] / LayoutTests / accessibility / ios-simulator / selected-text.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <script src="../../editing/editing.js" language="JavaScript" type="text/JavaScript" ></script>
6 <script>
7 var successfullyParsed = false;
8 </script>
9 </head>
10 <body id="body">
11
12 Text before
13 <div tabindex=0 id="container">This is a test of Safari web selection</div>
14 Text after
15
16 <p id="description"></p>
17 <div id="console"></div>
18
19 <script>
20
21     description("This tests that accessibility can pull out the selected text");
22
23     if (window.accessibilityController) {
24         document.getElementById("container").focus();
25         setSelectionCommand(document.getElementById('container'), 0, document.getElementById('container'), 0);
26
27         var focusedElement = accessibilityController.focusedElement;
28
29         // Select: "This is"
30         for (var k = 0; k < 7; k++) 
31             focusedElement.increaseTextSelection();
32
33         // "Unselect: " is"
34         for (var k = 0; k < 3; k++) 
35             focusedElement.decreaseTextSelection();
36
37         shouldBe("focusedElement.stringForSelection", "'This'");
38     }
39
40     successfullyParsed = true;
41 </script>
42
43 <script src="../../resources/js-test-post.js"></script>
44 </body>
45 </html>
46