Move platformName property from testRunner to accessibilityController
[WebKit-https.git] / LayoutTests / accessibility / ignore-spacer-elements.html
1 <html>
2 <script>
3     if (window.testRunner)
4         testRunner.dumpAsText();
5 </script>
6 <body id="body">
7  
8     <!-- This test makes sure that spacer elements are not returned as elements. There should be at most 4 elements returned -->
9  
10    <b>First</b>
11    <b>Second</b>
12    <a href="http://www.apple.com">Apple</a>
13    <a href="http://www.yahoo.com">Yahoo</a>
14
15     
16     <div id="result"></div>
17
18      
19     <script>
20         if (window.accessibilityController) {
21             var result = document.getElementById("result");
22
23             var body = document.getElementById("body");
24             body.focus();
25             var container = accessibilityController.focusedElement.childAtIndex(0);
26
27             // The Gtk and EFL ports ATs expect the bold inline text to not have accessible objects.
28             var expectedCount = accessibilityController.platformName == "atk" ? 2 : 4;
29             if (container.childrenCount == expectedCount) {
30                 result.innerText += "Test passed\n";
31             }
32             else {
33                  result.innerText += "Test failed\n";
34             }
35         }
36     </script>
37 </body>
38 </html>