Title: [215783] trunk/LayoutTests
Revision
215783
Author
d...@apple.com
Date
2017-04-25 18:45:04 -0700 (Tue, 25 Apr 2017)

Log Message

REGRESSION (r214129): fast/media/mq-prefers-reduced-motion.html fails
https://bugs.webkit.org/show_bug.cgi?id=171303
<rdar://problem/31434879>

Reviewed by Brent Fulgham.

This particular test was calling notifyDone() from within
a callback triggered by the UIScriptController script, which
meant that by the time the controller tried to call its callback,
the test had finished.

* fast/media/mq-prefers-reduced-motion-matchMedia.html: Make sure
notifyDone is called after both the callback-like functions have
triggered.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215782 => 215783)


--- trunk/LayoutTests/ChangeLog	2017-04-26 01:22:55 UTC (rev 215782)
+++ trunk/LayoutTests/ChangeLog	2017-04-26 01:45:04 UTC (rev 215783)
@@ -1,3 +1,20 @@
+2017-04-25  Dean Jackson  <d...@apple.com>
+
+        REGRESSION (r214129): fast/media/mq-prefers-reduced-motion.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=171303
+        <rdar://problem/31434879>
+
+        Reviewed by Brent Fulgham.
+
+        This particular test was calling notifyDone() from within
+        a callback triggered by the UIScriptController script, which
+        meant that by the time the controller tried to call its callback,
+        the test had finished.
+
+        * fast/media/mq-prefers-reduced-motion-matchMedia.html: Make sure
+        notifyDone is called after both the callback-like functions have
+        triggered.
+
 2017-04-25  John Wilander  <wilan...@apple.com>
 
         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting

Modified: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-matchMedia.html (215782 => 215783)


--- trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-matchMedia.html	2017-04-26 01:22:55 UTC (rev 215782)
+++ trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-matchMedia.html	2017-04-26 01:45:04 UTC (rev 215783)
@@ -15,21 +15,31 @@
     var motionQuery = window.matchMedia("(prefers-reduced-motion)");
     motionQuery.addListener(() => {
         document.getElementById("after").textContent = motionQuery.matches ? "true" : "false";
-        testRunner.notifyDone();
+        queryFired = true;
+        checkDone();
     });
 
     document.getElementById("before").textContent = motionQuery.matches ? "true" : "false";
     window.internals.settings.forcedPrefersReducedMotionAccessibilityValue = "on";
-    if (testRunner.runUIScript) {
-        testRunner.runUIScript(`
-            (function() {
-                uiController.simulateAccessibilitySettingsChangeNotification(function() {
-                    uiController.uiScriptComplete("Done");
-                });
-            })();`);
-    }
+    testRunner.runUIScript(`
+        (function() {
+            uiController.simulateAccessibilitySettingsChangeNotification(function() {
+                uiController.uiScriptComplete("Done");
+            });
+        })();`, function (result) {
+            scriptRan = true;
+            checkDone();
+        });
 }
 
+let queryFired = false;
+let scriptRan = false;
+
+function checkDone() {
+    if (queryFired && scriptRan)
+        testRunner.notifyDone();
+}
+
 window.addEventListener("load", runTest, false);
 </script>
 </head>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to