Title: [261186] trunk/LayoutTests
Revision
261186
Author
commit-qu...@webkit.org
Date
2020-05-05 11:44:58 -0700 (Tue, 05 May 2020)

Log Message

[ Mac ] fast/animation/request-animation-frame-cancel2.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209491

Patch by Said Abou-Hallawa <sabouhall...@apple.com> on 2020-05-05
Reviewed by Antoine Quint.

Make the test asynchronous instead of using timers to fix its flakiness.

* fast/animation/request-animation-frame-cancel2.html:
* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261185 => 261186)


--- trunk/LayoutTests/ChangeLog	2020-05-05 18:42:55 UTC (rev 261185)
+++ trunk/LayoutTests/ChangeLog	2020-05-05 18:44:58 UTC (rev 261186)
@@ -1,3 +1,15 @@
+2020-05-05  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        [ Mac ] fast/animation/request-animation-frame-cancel2.html is flaky failing.
+        https://bugs.webkit.org/show_bug.cgi?id=209491
+
+        Reviewed by Antoine Quint.
+
+        Make the test asynchronous instead of using timers to fix its flakiness.
+
+        * fast/animation/request-animation-frame-cancel2.html:
+        * platform/mac/TestExpectations:
+
 2020-05-05  Mark Lam  <mark....@apple.com>
 
         Allow Bitmap to use up to a UCPURegister word size for internal bit storage.

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-cancel2.html (261185 => 261186)


--- trunk/LayoutTests/fast/animation/request-animation-frame-cancel2.html	2020-05-05 18:42:55 UTC (rev 261185)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-cancel2.html	2020-05-05 18:44:58 UTC (rev 261186)
@@ -4,41 +4,39 @@
 <script src=""
 </head>
 <body>
-<span id="e"></span>
-<span id="f"></span>
 <script>
-description("Tests one requestAnimationFrame callback cancelling a second");
+    var callbackFired = false;
+    var cancelFired = false;
 
-var e = document.getElementById("e");
-var secondCallbackId;
-var callbackFired = false;
-var cancelFired = false;
+    function firstRequestAnimationFrame() {
+        return new Promise(resolve => {
+            window.requestAnimationFrame(() => {
+                window.cancelAnimationFrame(secondCallbackId);
+                cancelFired = true;
+                resolve();
+            });
+        });
+    }
 
-window.requestAnimationFrame(function() {
-    cancelFired = true;
-    window.cancelAnimationFrame(secondCallbackId);
-}, e);
+    function secondRequestAnimationFrame() {
+        return new Promise(resolve => {
+            secondCallbackId = window.requestAnimationFrame(() => {
+                callbackFired = true;
+                resolve();
+            });
+            setTimeout(resolve, 100);
+        });
+    }
 
-secondCallbackId = window.requestAnimationFrame(function() {
-    callbackFired = true;
-}, e);
+    description("Tests one requestAnimationFrame callback cancelling a second");
+    window.jsTestIsAsync = true;
 
-if (window.testRunner)
-    testRunner.displayAndTrackRepaints();
-
-setTimeout(function() {
-    shouldBeFalse("callbackFired");
-    shouldBeTrue("cancelFired");
-}, 100);
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-
-setTimeout(function() {
-    isSuccessfullyParsed();
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 200);
+    Promise.all([firstRequestAnimationFrame(), secondRequestAnimationFrame()]).then(() => {
+        shouldBeFalse("callbackFired");
+        shouldBeTrue("cancelFired");
+        finishJSTest();
+    });
 </script>
+<script src=""
 </body>
 </html>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (261185 => 261186)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-05-05 18:42:55 UTC (rev 261185)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-05-05 18:44:58 UTC (rev 261186)
@@ -1940,8 +1940,6 @@
 
 webkit.org/b/209446 [ Debug ] imported/w3c/web-platform-tests/navigation-timing/test_timing_attributes_order.html [ Pass Failure ]
 
-webkit.org/b/209491 fast/animation/request-animation-frame-cancel2.html [ Pass Failure ]
-
 webkit.org/b/209619 [ Catalina ] compositing/clipping/border-radius-async-overflow-stacking.html [ Pass ImageOnlyFailure ]
 
 webkit.org/b/208023 [ Catalina ] fast/text/international/system-language/declarative-language.html [ Failure ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to