buildAccessibilityTree() needs to be removed from individual layout tests
authormario.prada@samsung.com <mario.prada@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jul 2014 15:31:57 +0000 (15:31 +0000)
committermario.prada@samsung.com <mario.prada@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jul 2014 15:31:57 +0000 (15:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95286

Reviewed by Chris Fleizach.

Extracted two functions to 'dump' and 'touch' the accessibility
hierarchies out of different layout tests and into a single file,
living in LayoutTests/resources/accessibility-helper.js

* resources/accessibility-helper.js: Added.
(dumpAccessibilityTree): New, based on buildAccessibilityTree()
for the cases where it was used to actually 'dump' it into the output.
(touchAccessibilityTree): Same, but for the cases where we don't
want to dump the accessibility tree, just to make sure is generated.

Updated affected layout tests to use the newly added helper functions.

* accessibility/adjacent-continuations-cause-assertion-failure.html: Updated.
* accessibility/children-changed-sends-notification.html: Ditto.
* accessibility/deleting-iframe-destroys-axcache.html: Ditto.
* accessibility/div-within-anchors-causes-crash.html: Ditto.
* accessibility/first-letter-text-transform-causes-crash.html: Ditto.
* accessibility/image-map-update-parent-crash.html: Ditto.
* accessibility/table-with-empty-thead-causes-crash.html: Ditto.
* platform/efl/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/entry-and-password.html: Ditto.
* platform/gtk/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Ditto.

Updated Mac specific expectations not to print the "End of test" element.

* platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
* platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Ditto.
* platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt: Ditto.
* platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170806 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html
LayoutTests/accessibility/children-changed-sends-notification-expected.txt
LayoutTests/accessibility/children-changed-sends-notification.html
LayoutTests/accessibility/deleting-iframe-destroys-axcache.html
LayoutTests/accessibility/div-within-anchors-causes-crash.html
LayoutTests/accessibility/first-letter-text-transform-causes-crash.html
LayoutTests/accessibility/image-map-update-parent-crash.html
LayoutTests/accessibility/table-with-empty-thead-causes-crash.html
LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html
LayoutTests/platform/gtk/accessibility/entry-and-password.html
LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html
LayoutTests/platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html
LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt
LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt
LayoutTests/platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt
LayoutTests/platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt
LayoutTests/resources/accessibility-helper.js [new file with mode: 0644]

index 8b4e199..5cb8ef0 100644 (file)
@@ -1,3 +1,41 @@
+2014-07-04  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        buildAccessibilityTree() needs to be removed from individual layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=95286
+
+        Reviewed by Chris Fleizach.
+
+        Extracted two functions to 'dump' and 'touch' the accessibility
+        hierarchies out of different layout tests and into a single file,
+        living in LayoutTests/resources/accessibility-helper.js
+
+        * resources/accessibility-helper.js: Added.
+        (dumpAccessibilityTree): New, based on buildAccessibilityTree()
+        for the cases where it was used to actually 'dump' it into the output.
+        (touchAccessibilityTree): Same, but for the cases where we don't
+        want to dump the accessibility tree, just to make sure is generated.
+
+        Updated affected layout tests to use the newly added helper functions.
+
+        * accessibility/adjacent-continuations-cause-assertion-failure.html: Updated.
+        * accessibility/children-changed-sends-notification.html: Ditto.
+        * accessibility/deleting-iframe-destroys-axcache.html: Ditto.
+        * accessibility/div-within-anchors-causes-crash.html: Ditto.
+        * accessibility/first-letter-text-transform-causes-crash.html: Ditto.
+        * accessibility/image-map-update-parent-crash.html: Ditto.
+        * accessibility/table-with-empty-thead-causes-crash.html: Ditto.
+        * platform/efl/accessibility/media-emits-object-replacement.html: Ditto.
+        * platform/gtk/accessibility/entry-and-password.html: Ditto.
+        * platform/gtk/accessibility/media-emits-object-replacement.html: Ditto.
+        * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Ditto.
+
+        Updated Mac specific expectations not to print the "End of test" element.
+
+        * platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
+        * platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Ditto.
+        * platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt: Ditto.
+        * platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt: Ditto.
+
 2014-07-04  Antti Koivisto  <antti@apple.com>
 
         REGRESSION(r159345): Lines are clipped between pages when printing web content from Safari
index 27bc8b0..ca4019a 100644 (file)
@@ -1,36 +1,14 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
-<script>
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = "";
-        for (var i = 0; i < indent; i++)
-            str += "    ";
-        str += accessibilityObject.role;
-        str += " " + accessibilityObject.stringValue;
-        str += "\n";
-        document.getElementById("tree").innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-</script>
 <script src="../resources/js-test-pre.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
 <span><div></div></span><span>x<div>y</div>z</span>
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <p id="description"></p>
 <pre id="tree"></pre>
 
     if (window.accessibilityController) {
         // Build the accessibility tree up until 'End of test' is encountered.
+        window.stopElement = accessibilityController.accessibleElementById("stopElement")
+
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
     }
 
 </script>
index 8ec2683..a5b61fb 100644 (file)
@@ -5,7 +5,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 Plain text paragraph 
 
-End of test
 PARAGRAPH notification: AXChildrenAdded
 GLOBAL notification: AXChildrenAdded on element with role AXRole: AXParagraph
 PARAGRAPH notification: AXChildrenRemoved
index 1f8a67c..2fa44cf 100644 (file)
@@ -1,12 +1,12 @@
 <html>
 <head>
 <script src="../resources/js-test-pre.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
 <p id="description"></p>
 <p id="paragraph">Plain text paragraph <a id="testLink" href="#">with a link at the end</a></p>
-<div>End of test</div>
 
 <div id="console"></div>
 
@@ -15,19 +15,6 @@ window.jsTestIsAsync = true;
 
 description("This test ensures that a notification is being emitted when children are added or removed for an accessibility object");
 
-function touchAccessibilityTree(accessibilityObject) {
-    if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i < count; ++i) {
-        if (!touchAccessibilityTree(accessibilityObject.childAtIndex(i)))
-            return false;
-    }
-
-    return true;
-}
-
 function runTest() {
     window.paragraphNotificationCount = 0;
     window.globalNotificationCount = 0;
index 822d127..b443759 100644 (file)
@@ -1,42 +1,19 @@
 <html>
 <head>
 <script src="../resources/js-test-pre.js"></script>
-
-  <script>
+<script src="../resources/accessibility-helper.js"></script>
+<script>
     if (window.testRunner)
         testRunner.waitUntilDone();
 
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = "";
-        for (var i = 0; i < indent; i++)
-            str += "    ";
-        str += accessibilityObject.role;
-        str += " " + accessibilityObject.stringValue;
-
-        if (accessibilityObject.role == '')
-            str += accessibilityObject.allAttributes();
-
-        str += "\n";
-        document.getElementById("console").innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-
     function runTest()
     {
         description("This tests that deleting an iframe doesn't cause the accessibility cache to be destroyed and recreated.");
 
         if (window.accessibilityController) {
             window.root = accessibilityController.rootElement;
+            window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
             window.body = root.childAtIndex(0);
             window.before = body.childAtIndex(0);
             window.iframe = body.childAtIndex(1).childAtIndex(0);
@@ -49,8 +26,8 @@
             window.frameButton = window.frameGroup.childAtIndex(0);
             window.frameButtonRole = window.frameButton.role;
 
-            document.getElementById("console").innerText += "\nBefore:\n";
-            buildAccessibilityTree(root, 0);
+            document.getElementById("tree").innerText += "\nBefore:\n";
+            dumpAccessibilityTree(root, stopElement, 0, true);
 
             // Remove the iframe.
             document.body.removeChild(document.getElementById("iframe"));
@@ -60,9 +37,9 @@
             window.newBefore = newBody.childAtIndex(0);
             window.newAfter = newBody.childAtIndex(1);
 
-            document.getElementById("console").innerText += "\nAfter:\n";
-            buildAccessibilityTree(newRoot, 0);
-            document.getElementById("console").innerText += "\n";
+            document.getElementById("tree").innerText += "\nAfter:\n";
+            dumpAccessibilityTree(newRoot, stopElement, 0, true);
+            document.getElementById("tree").innerText += "\n";
 
             // Make sure that the accessibility objects from the iframe's nodes
             // are now invalid by checking that their role is changed - this
 
 <p>After</p>
 
-<p>End of test</p>
+<p id="stopElement">End of test</p>
 
 <p id="description"></p>
+<pre id="tree"></pre>
 <div id="console"></div>
 
 </body>
index 8df4134..bb19025 100644 (file)
@@ -1,30 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 
 <html> 
 <head>
-<script> 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = "";
-        for (var i = 0; i < indent; i++)
-            str += "    ";
-        str += accessibilityObject.role;
-        str += " " + accessibilityObject.stringValue;
-        str += "\n";
-        document.getElementById("tree").innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-</script> 
 <script src="../resources/js-test-pre.js"></script> 
+<script src="../resources/accessibility-helper.js"></script>
 </head> 
 <body> 
  
@@ -34,7 +12,7 @@
 
 <a href="about:blank"><div></div></a> 
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <pre id="tree"></pre>
  
  
     if (window.accessibilityController) {
         // First build up full accessibility tree.
+        window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
         document.getElementById("tree").innerText += "Before:\n";
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
-        
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
+
         // Remove anchor that causes debug assert in AccessibilityRenderObject::addChildren
         document.body.removeChild(document.body.children[2])
         
         // Build up full accessibility tree again.
         document.getElementById("tree").innerText += "After:\n";
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
     }
  
 </script> 
index 37d27fd..a85a006 100644 (file)
@@ -4,15 +4,8 @@
 <style>
        dt:first-letter{text-transform:uppercase;}
 </style>
-<script>
-
-    function buildAccessibilityTree(accessibilityObject) {
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i)
-            buildAccessibilityTree(accessibilityObject.childAtIndex(i));
-    }
-</script>
 <script src="../resources/js-test-pre.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
@@ -30,7 +23,7 @@
     if (window.accessibilityController) {
         // Build up full accessibility tree.
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement);
+        touchAccessibilityTree(accessibilityController.focusedElement);
     }
 
 </script>
index d63d317..e4335a3 100644 (file)
@@ -1,34 +1,24 @@
 <html>
 <head>
 <script src="../resources/js-test-pre.js"></script>
-
+<script src="../resources/accessibility-helper.js"></script>
 <script>
 
 if (window.testRunner)
   testRunner.waitUntilDone();
 
-function buildAccessibilityTree(accessibilityObject, indent) {
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i < count; ++i) {
-         if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-
 function runAXTest() {
 
 
    description("This tests that an image map's hold on it's parent will be cleared if the parent goes away.");
 
    // First access all children using AX
-   buildAccessibilityTree(accessibilityController.rootElement, 0);
+   touchAccessibilityTree(accessibilityController.rootElement);
 
    var child = document.getElementById('img'); child.parentNode.removeChild(child);
+
    // Now verify we haven't crashed.
-   buildAccessibilityTree(accessibilityController.rootElement, 0);
+   touchAccessibilityTree(accessibilityController.rootElement);
 
    if (window.testRunner)
        testRunner.notifyDone();
index 70e26a5..f2cf47f 100644 (file)
@@ -1,17 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
-<script>
-
-    function buildAccessibilityTree(accessibilityObject) {
-        accessibilityObject.isEnabled
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i)
-            buildAccessibilityTree(accessibilityObject.childAtIndex(i));
-    }
-</script>
 <script src="../resources/js-test-pre.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
@@ -29,7 +20,7 @@
 
     if (window.accessibilityController) {
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement);
+        touchAccessibilityTree(accessibilityController.focusedElement);
     }
 
 </script>
index 4ce11ff..9b58651 100644 (file)
@@ -1,29 +1,8 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-<script>
-function buildAccessibilityTree(accessibilityObject, indent) {
-    var str = "";
-    for (var i = 0; i < indent; i++)
-        str += "    ";
-    str += accessibilityObject.role;
-    str += " " + accessibilityObject.stringValue;
-    str += "\n";
-    document.getElementById("tree").innerText += str;
-
-    if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i < count; ++i) {
-        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-</script>
 <script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
@@ -39,7 +18,7 @@ a <audio width=100 height=100 controls></audio> b
 
 </div>
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <pre id="tree"></pre>
 
@@ -51,8 +30,10 @@ description("This tests ensures that if video or audio tags are used, they will
 
 if (window.accessibilityController) {
     // Build the accessibility tree up until 'End of test' is encountered.
+    window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
     document.body.focus();
-    buildAccessibilityTree(accessibilityController.focusedElement, 0);
+    dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
 }
 </script>
 <script src="../../../resources/js-test-post.js"></script>
index 47893ad..91abc51 100644 (file)
@@ -1,30 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 
 <html> 
 <head>
-<script> 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = "";
-        for (var i = 0; i < indent; i++)
-            str += "    ";
-        str += accessibilityObject.role;
-        str += " " + accessibilityObject.stringValue;
-        str += "\n";
-        document.getElementById("tree").innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-</script> 
 <script src="../../../resources/js-test-pre.js"></script> 
+<script src="../../../resources/accessibility-helper.js"></script>
 </head> 
 <body> 
  
@@ -33,7 +11,7 @@
 <input type='password' name='passwordEntry' value='123' />
 </form>
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <pre id="tree"></pre>
  
 
     if (window.accessibilityController) {
         // Build the accessibility tree up until 'End of test' is encountered.
+        window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
     }
 
 </script>
index 4ce11ff..9b58651 100644 (file)
@@ -1,29 +1,8 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-<script>
-function buildAccessibilityTree(accessibilityObject, indent) {
-    var str = "";
-    for (var i = 0; i < indent; i++)
-        str += "    ";
-    str += accessibilityObject.role;
-    str += " " + accessibilityObject.stringValue;
-    str += "\n";
-    document.getElementById("tree").innerText += str;
-
-    if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i < count; ++i) {
-        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-</script>
 <script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../resources/accessibility-helper.js"></script>
 </head>
 <body>
 
@@ -39,7 +18,7 @@ a <audio width=100 height=100 controls></audio> b
 
 </div>
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <pre id="tree"></pre>
 
@@ -51,8 +30,10 @@ description("This tests ensures that if video or audio tags are used, they will
 
 if (window.accessibilityController) {
     // Build the accessibility tree up until 'End of test' is encountered.
+    window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
     document.body.focus();
-    buildAccessibilityTree(accessibilityController.focusedElement, 0);
+    dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
 }
 </script>
 <script src="../../../resources/js-test-post.js"></script>
index 8b98c6b..db5d3d9 100644 (file)
@@ -1,30 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 
 <html> 
 <head>
-<script> 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = "";
-        for (var i = 0; i < indent; i++)
-            str += "    ";
-        str += accessibilityObject.role;
-        str += " " + accessibilityObject.stringValue;
-        str += "\n";
-        document.getElementById("tree").innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i < count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-</script> 
-<script src="../../../resources/js-test-pre.js"></script> 
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../resources/accessibility-helper.js"></script>
 </head> 
 <body> 
  
@@ -47,7 +25,7 @@ Heading
 <img src="foo" alt="I should be an image" />
 </h3>
 
-<div>End of test</div>
+<div id="stopElement">End of test</div>
 
 <pre id="tree"></pre>
  
@@ -59,8 +37,10 @@ Heading
 
     if (window.accessibilityController) {
         // Build the accessibility tree up until 'End of test' is encountered.
+        window.stopElement = accessibilityController.accessibleElementById("stopElement");
+
         document.body.focus();
-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
     }
 
 </script>
index 8249ebe..3d4e954 100644 (file)
@@ -23,7 +23,6 @@ AXRole: AXScrollArea AXValue:
         AXRole: AXGroup AXValue: 
             AXRole: AXStaticText AXValue: After
         AXRole: AXGroup AXValue: 
-            AXRole: AXStaticText AXValue: End of test
 
 After:
 AXRole: AXScrollArea AXValue: 
@@ -33,7 +32,6 @@ AXRole: AXScrollArea AXValue:
         AXRole: AXGroup AXValue: 
             AXRole: AXStaticText AXValue: After
         AXRole: AXGroup AXValue: 
-            AXRole: AXStaticText AXValue: End of test
 
 PASS frameBodyRole == frameBody.role is false
 PASS frameGroupRole == frameGroup.role is false
index 963bb2f..cb71ade 100644 (file)
@@ -13,7 +13,6 @@ AXRole: AXWebArea AXValue:
         AXRole: AXStaticText AXValue: y
     AXRole: AXStaticText AXValue: z
     AXRole: AXGroup AXValue: 
-        AXRole: AXStaticText AXValue: End of test
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 5a36718..74db9dd 100644 (file)
@@ -23,7 +23,6 @@ AXRole: AXScrollArea
         AXRole: AXGroup AXValue: 
             AXRole: AXStaticText AXValue: After
         AXRole: AXGroup AXValue: 
-            AXRole: AXStaticText AXValue: End of test
 
 After:
 AXRole: AXScrollArea 
@@ -33,7 +32,6 @@ AXRole: AXScrollArea
         AXRole: AXGroup AXValue: 
             AXRole: AXStaticText AXValue: After
         AXRole: AXGroup AXValue: 
-            AXRole: AXStaticText AXValue: End of test
 
 PASS frameBodyRole == frameBody.role is false
 PASS frameGroupRole == frameGroup.role is false
index 15a2c68..34ad8e2 100644 (file)
@@ -3,11 +3,9 @@ Before:
 AXRole: AXWebArea AXValue: 
     AXRole: AXLink AXValue: 
     AXRole: AXGroup AXValue: 
-        AXRole: AXStaticText AXValue: End of test
 After:
 AXRole: AXWebArea AXValue: 
     AXRole: AXGroup AXValue: 
-        AXRole: AXStaticText AXValue: End of test
 This can cause a crash.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/resources/accessibility-helper.js b/LayoutTests/resources/accessibility-helper.js
new file mode 100644 (file)
index 0000000..ec6adbc
--- /dev/null
@@ -0,0 +1,34 @@
+function dumpAccessibilityTree(accessibilityObject, stopElement, indent, allAttributesIfNeeded) {
+    var str = "";
+    var i = 0;
+
+    for (i = 0; i < indent; i++)
+        str += "    ";
+    str += accessibilityObject.role;
+    str += " " + accessibilityObject.stringValue;
+    str += allAttributesIfNeeded && accessibilityObject.role == '' ? accessibilityObject.allAttributes() : '';
+    str += "\n";
+
+    document.getElementById("tree").innerText += str;
+
+    if (stopElement && stopElement.isEqual(accessibilityObject))
+        return;
+
+    var count = accessibilityObject.childrenCount;
+    for (i = 0; i < count; ++i) {
+        if (!dumpAccessibilityTree(accessibilityObject.childAtIndex(i), stopElement, indent + 1, allAttributesIfNeeded))
+            return false;
+    }
+
+    return true;
+}
+
+function touchAccessibilityTree(accessibilityObject) {
+    var count = accessibilityObject.childrenCount;
+    for (var i = 0; i < count; ++i) {
+        if (!touchAccessibilityTree(accessibilityObject.childAtIndex(i)))
+            return false;
+    }
+
+    return true;
+}