Clean up asynchronous behavior in some accessibility tests
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Sep 2015 18:41:09 +0000 (18:41 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Sep 2015 18:41:09 +0000 (18:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148682

Reviewed by Darin Adler.

* accessibility/mac/removing-textarea-after-edit-crash-expected.txt:
* accessibility/mac/removing-textarea-after-edit-crash.html:
* accessibility/mac/select-element-selection-with-optgroups.html:
* accessibility/mac/selected-rows-table.html:
* accessibility/mac/selection-notification-focus-change.html:
* accessibility/mac/selection-sync-expected.txt:
* accessibility/mac/selection-sync.html:
* accessibility/mac/setting-attributes-is-asynchronous.html:

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

LayoutTests/ChangeLog
LayoutTests/accessibility/mac/removing-textarea-after-edit-crash-expected.txt
LayoutTests/accessibility/mac/removing-textarea-after-edit-crash.html
LayoutTests/accessibility/mac/select-element-selection-with-optgroups.html
LayoutTests/accessibility/mac/selected-rows-table.html
LayoutTests/accessibility/mac/selection-notification-focus-change.html
LayoutTests/accessibility/mac/selection-sync-expected.txt
LayoutTests/accessibility/mac/selection-sync.html
LayoutTests/accessibility/mac/setting-attributes-is-asynchronous.html

index bfb5f50..1f42ac4 100644 (file)
@@ -1,3 +1,19 @@
+2015-09-01  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up asynchronous behavior in some accessibility tests
+        https://bugs.webkit.org/show_bug.cgi?id=148682
+
+        Reviewed by Darin Adler.
+
+        * accessibility/mac/removing-textarea-after-edit-crash-expected.txt:
+        * accessibility/mac/removing-textarea-after-edit-crash.html:
+        * accessibility/mac/select-element-selection-with-optgroups.html:
+        * accessibility/mac/selected-rows-table.html:
+        * accessibility/mac/selection-notification-focus-change.html:
+        * accessibility/mac/selection-sync-expected.txt:
+        * accessibility/mac/selection-sync.html:
+        * accessibility/mac/setting-attributes-is-asynchronous.html:
+
 2015-09-01  Dean Jackson  <dino@apple.com>
 
         The new media controls tests are OS X only.
index 8262153..7de01ed 100644 (file)
@@ -3,4 +3,7 @@ This tests that when an element is removed from the DOM while a notification ref
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
index 28b61c5..55ad2f2 100644 (file)
@@ -30,7 +30,7 @@ text
             document.getElementById("div").style.display = "NONE";
 
             // we now have to wait for the value change to be propagated to trigger the crash.
-            setTimeout("window.testRunner.notifyDone();", 1);
+            setTimeout(finishJSTest, 1);
         }
     }
 </script>
@@ -38,7 +38,7 @@ text
 <script>
     var req = 0;
     if (window.accessibilityController) {  
-        window.testRunner.waitUntilDone();
+        window.jsTestIsAsync = true;
         document.getElementById("body").focus();
         body = accessibilityController.focusedElement;
 
@@ -52,10 +52,10 @@ text
         req.open("get", "../../../http/tests/xmlhttprequest/methods.cgi", true);
         // Sending this after a timeout makes is so that the layout does not happen until the value change is sent.
         setTimeout("req.send('')", 1);
-
-    }
+    } else
+        debug("window.accessibilityController is not present");
 
 </script>
-
+<script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
index ff4f1d6..7014f96 100644 (file)
@@ -23,9 +23,9 @@
 
 <script>
 description("This tests that setting selection within a list box works correctly if there are optgroups");
-window.jsTestIsAsync = true;
 
 if (window.accessibilityController) {
+    window.jsTestIsAsync = true;
     document.getElementById("suite").focus();
     var selectElement = accessibilityController.focusedElement;
 
@@ -51,7 +51,8 @@ if (window.accessibilityController) {
             });
         });
     });
-}
+} else
+    debug("window.accessibilityController is not present");
 </script>
 
 <script src="../../resources/js-test-post.js"></script>
index a2b52ad..bbd0ed0 100644 (file)
         document.getElementById("notifications").innerHTML += "Notification: " + notification + "<br>";
         if (notification == "AXSelectedRowsChanged") {
             axTree.removeNotificationListener();
-            window.testRunner.notifyDone();
+            finishJSTest();
         }
     }
 
     if (window.accessibilityController) {
-        window.testRunner.waitUntilDone();
+        window.jsTestIsAsync = true;
 
         document.getElementById("grid").focus();
 
@@ -60,7 +60,8 @@
 
         // Change the selected state to ensure the notification is sent.
         document.getElementById("row0").setAttribute("aria-selected", "false");
-    }
+    } else
+        debug("window.accessibilityController is not present");
 
 </script>
 
index 4aa8ba9..ba2d71c 100644 (file)
@@ -72,6 +72,9 @@
                     shouldBeTrue("addedNotification");
 
                     eventSender.keyDown("\t");
+                } else {
+                    debug("window.accessibilityController is not present");
+                    finishJSTest();
                 }
             }
             </script>
index 2e00b8e..f747603 100644 (file)
@@ -6,9 +6,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS addedNotification is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
 PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeSelectionMove
 PASS results[resultIndex]["AXTextSelectionDirection"] is AXTextSelectionDirectionDiscontiguous
 PASS results[resultIndex]["AXTextStateSync"] is true
@@ -24,4 +21,7 @@ PASS results[resultIndex]["AXTextStateSync"] is true
 PASS results[resultIndex]["AXTextStateChangeType"] is AXTextStateChangeTypeSelectionExtend
 PASS results[resultIndex]["AXTextSelectionDirection"] is AXTextSelectionDirectionDiscontiguous
 PASS results[resultIndex]["AXTextStateSync"] is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
index e932b23..acb7e0c 100644 (file)
                 shouldBe("results[resultIndex][\"AXTextStateSync\"]", "true");
 
                 webArea.removeNotificationListener();
-                window.testRunner.notifyDone();
+                finishJSTest();
             }
         }
     }
 
     if (window.accessibilityController) {
-        window.testRunner.waitUntilDone();
+        window.jsTestIsAsync = true;
 
         accessibilityController.enableEnhancedAccessibility(true);
 
         var extendRange = axTextbox.textMarkerRangeForMarkers(markerThree, markerFour);
         webArea.setSelectedVisibleTextRange(moveRange);
         webArea.setSelectedVisibleTextRange(extendRange);
-    }
+    } else
+        debug("window.accessibilityController is not present");
 
 </script>
-
 <script src="../../resources/js-test-post.js"></script>
 </body>
 </html>
index 7ae2694..af978e7 100644 (file)
 description("This tests makes sure that setting accessibility attributes happens asychronously, so that a caller won't hang if the result is an alert.")
 
 if (window.testRunner && window.accessibilityController) {
-    
    window.jsTestIsAsync = true;
    var textfield = accessibilityController.accessibleElementById("textfield");
    textfield.takeFocus();
    debug("This line should be printed first");
-}
+} else
+   debug((window.testRunner ? "window.testRunner" : "window.accessibilityController") + " is not present");
 
 </script>
-
 <script src="../../resources/js-test-post.js"></script>
 </body>
 </html>