AX: Fix flaky accessibility/loading-iframe-sends-notification.html
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 19:51:02 +0000 (19:51 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 19:51:02 +0000 (19:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194546

Reviewed by Zalan Bujtas.

This test was relying on timing between load events being sent and accessibility events being sent.
We don't need to do that, we can more directly test this interplay.

* accessibility/loading-iframe-sends-notification-expected.txt:
* accessibility/loading-iframe-sends-notification.html:

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

LayoutTests/ChangeLog
LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt
LayoutTests/accessibility/loading-iframe-sends-notification.html

index 93ad21d..172e399 100644 (file)
@@ -1,3 +1,16 @@
+2019-02-12  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Fix flaky accessibility/loading-iframe-sends-notification.html
+        https://bugs.webkit.org/show_bug.cgi?id=194546
+
+        Reviewed by Zalan Bujtas.
+
+        This test was relying on timing between load events being sent and accessibility events being sent.
+        We don't need to do that, we can more directly test this interplay.
+
+        * accessibility/loading-iframe-sends-notification-expected.txt:
+        * accessibility/loading-iframe-sends-notification.html:
+
 2019-02-12  Adrian Perez de Castro  <aperez@igalia.com>
 
         Unreviewed WPE gardening. Unskip content extensions tests after r241283
index 5231294..9e601f9 100644 (file)
@@ -13,7 +13,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS findByAccessibleTitleSubstring(root, 'InnerButton') != null is false
 Got notification on iframe.
 PASS findByAccessibleTitleSubstring(root, 'InnerButton') != null is true
-PASS gotIframeNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 7f6b876..1b7f7a7 100644 (file)
@@ -42,8 +42,6 @@
 
     function runTest()
     {
-        window.gotIframeNotification = false;
-
         if (window.accessibilityController) {
             window.root = accessibilityController.rootElement;
 
                     return;
 
                 debug("Got notification on iframe.");
-                gotIframeNotification = true;
 
                 // Check that the button within the iframe is now reachable from the root.
                 shouldBeTrue("findByAccessibleTitleSubstring(root, 'InnerButton') != null");
+                accessibilityController.removeNotificationListener();
+                finishJSTest();
             });
         }
 
         window.iframeElement = document.getElementById("iframe");
-        iframeElement.addEventListener("load", function() {
-            window.setTimeout(function() {
-                shouldBeTrue("gotIframeNotification");
-                if (window.accessibilityController)
-                    accessibilityController.removeNotificationListener();
-
-                finishJSTest();
-            }, 10);
-        }, false);
 
         // Load content into the iframe. This will trigger the event
         // handler above, which will check that the accessibility tree