Layout Test accessibility/mac/accessibility-make-first-responder.html is flaky
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 02:15:23 +0000 (02:15 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 02:15:23 +0000 (02:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183232

Reviewed by Chris Fleizach.

The test is flaky because that the UIProcess might have received the IPC message
to set the first responder after we check the current state. Added a delay
in the test to fix that.

* accessibility/mac/accessibility-make-first-responder.html:

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

LayoutTests/ChangeLog
LayoutTests/accessibility/mac/accessibility-make-first-responder.html

index 278b9fd..60963ec 100644 (file)
@@ -1,5 +1,18 @@
 2018-02-28  Nan Wang  <n_wang@apple.com>
 
+        Layout Test accessibility/mac/accessibility-make-first-responder.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=183232
+
+        Reviewed by Chris Fleizach.
+
+        The test is flaky because that the UIProcess might have received the IPC message
+        to set the first responder after we check the current state. Added a delay 
+        in the test to fix that.
+
+        * accessibility/mac/accessibility-make-first-responder.html:
+
+2018-02-28  Nan Wang  <n_wang@apple.com>
+
         AX: AOM: Dispatch accessiblesetvalue event
         https://bugs.webkit.org/show_bug.cgi?id=183021
         <rdar://problem/37764242>
index 10078c8..57af3dd 100644 (file)
         var input = document.getElementById("input");
         debug("DOM focus");
         input.focus();
-        testRunner.runUIScript(isWindowFirstResponderScript(), function(result) {
-            debug("Window is still the first responder: " + result);
-            input.blur();
-            // 2. Now make sure accessibility focus will make web content the first responder.
-            testAccessibilityMakeFirstResonder();
-        });
+        // Give it some delay for the IPC to happen.
+        setTimeout(function(){ 
+            testRunner.runUIScript(isWindowFirstResponderScript(), function(result) {
+                debug("Window is still the first responder: " + result);
+                input.blur();
+                // 2. Now make sure accessibility focus will make web content the first responder.
+                testAccessibilityMakeFirstResonder();
+            });
+        }, 100);
     }
     
     function testAccessibilityMakeFirstResonder() {
             var inputObj = accessibilityController.accessibleElementById("input");
             debug("Accessibility focus")
             inputObj.takeFocus();
-            testRunner.runUIScript(isWindowFirstResponderScript(), function(result) {
-                debug("Window is still the first responder: " + result);
-                finishTest();
-            });
+            // Give it some delay for the IPC to happen.
+            setTimeout(function(){ 
+                testRunner.runUIScript(isWindowFirstResponderScript(), function(result) {
+                    debug("Window is still the first responder: " + result);
+                    finishTest();
+                });
+            }, 100);
         }
     }