Title: [234641] trunk/LayoutTests
Revision
234641
Author
simon.fra...@apple.com
Date
2018-08-06 20:28:56 -0700 (Mon, 06 Aug 2018)

Log Message

De-flake some animation tests
https://bugs.webkit.org/show_bug.cgi?id=188356

Reviewed by Dean Jackson.

The tests in legacy-animation-engine were flakey because the animation can start before
we get a chance to register the event listener. Fix by starting the animation after the
load event fires. Make the non-legacy tests match.

* compositing/visible-rect/animated-from-none.html:
* compositing/visible-rect/animated.html:
* legacy-animation-engine/compositing/visible-rect/animated-from-none.html:
* legacy-animation-engine/compositing/visible-rect/animated.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (234640 => 234641)


--- trunk/LayoutTests/ChangeLog	2018-08-07 01:13:37 UTC (rev 234640)
+++ trunk/LayoutTests/ChangeLog	2018-08-07 03:28:56 UTC (rev 234641)
@@ -1,3 +1,19 @@
+2018-08-06  Simon Fraser  <simon.fra...@apple.com>
+
+        De-flake some animation tests
+        https://bugs.webkit.org/show_bug.cgi?id=188356
+
+        Reviewed by Dean Jackson.
+        
+        The tests in legacy-animation-engine were flakey because the animation can start before
+        we get a chance to register the event listener. Fix by starting the animation after the
+        load event fires. Make the non-legacy tests match.
+
+        * compositing/visible-rect/animated-from-none.html:
+        * compositing/visible-rect/animated.html:
+        * legacy-animation-engine/compositing/visible-rect/animated-from-none.html:
+        * legacy-animation-engine/compositing/visible-rect/animated.html:
+
 2018-08-06  Alex Christensen  <achristen...@webkit.org>
 
         Check with SafeBrowsing during navigation in WKWebView

Modified: trunk/LayoutTests/compositing/visible-rect/animated-from-none.html (234640 => 234641)


--- trunk/LayoutTests/compositing/visible-rect/animated-from-none.html	2018-08-07 01:13:37 UTC (rev 234640)
+++ trunk/LayoutTests/compositing/visible-rect/animated-from-none.html	2018-08-07 03:28:56 UTC (rev 234641)
@@ -34,7 +34,8 @@
 
         function doTest()
         {
-            document.getElementById('animated').addEventListener('webkitAnimationStart', function() {
+            let animated = document.getElementById('animated');
+            animated.addEventListener('webkitAnimationStart', function() {
                 if (window.internals)
                     document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
 
@@ -41,6 +42,8 @@
                 if (window.testRunner)
                     testRunner.notifyDone();
             }, false);
+            
+            animated.classList.add('animating');
         }
         window.addEventListener('load', doTest, false);
     </script>

Modified: trunk/LayoutTests/compositing/visible-rect/animated.html (234640 => 234641)


--- trunk/LayoutTests/compositing/visible-rect/animated.html	2018-08-07 01:13:37 UTC (rev 234640)
+++ trunk/LayoutTests/compositing/visible-rect/animated.html	2018-08-07 03:28:56 UTC (rev 234641)
@@ -17,6 +17,9 @@
             width: 200px;
             height: 200px;
             background-color: blue;
+        }
+        
+        .box.animating {
             -webkit-animation: move 20000000s linear;
         }
         
@@ -33,15 +36,16 @@
 
         function doTest()
         {
-            document.getElementById('animated').addEventListener('webkitAnimationStart', function() {
-                requestAnimationFrame(() => {
-                    if (window.internals)
-                        document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
+            let animated = document.getElementById('animated');
+            animated.addEventListener('webkitAnimationStart', function() {
+                if (window.internals)
+                    document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
 
-                    if (window.testRunner)
-                        testRunner.notifyDone();
-                });
+                if (window.testRunner)
+                    testRunner.notifyDone();
             }, false);
+
+            animated.classList.add('animating');
         }
         window.addEventListener('load', doTest, false);
     </script>

Modified: trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated-from-none.html (234640 => 234641)


--- trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated-from-none.html	2018-08-07 01:13:37 UTC (rev 234640)
+++ trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated-from-none.html	2018-08-07 03:28:56 UTC (rev 234641)
@@ -18,6 +18,9 @@
             width: 200px;
             height: 200px;
             background-color: blue;
+        }
+        
+        .box.animating {
             -webkit-animation: move 20000000s linear;
         }
         
@@ -34,7 +37,8 @@
 
         function doTest()
         {
-            document.getElementById('animated').addEventListener('webkitAnimationStart', function() {
+            let animated = document.getElementById('animated');
+            animated.addEventListener('webkitAnimationStart', function() {
                 if (window.internals)
                     document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
 
@@ -41,6 +45,8 @@
                 if (window.testRunner)
                     testRunner.notifyDone();
             }, false);
+            
+            animated.classList.add('animating');
         }
         window.addEventListener('load', doTest, false);
     </script>

Modified: trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated.html (234640 => 234641)


--- trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated.html	2018-08-07 01:13:37 UTC (rev 234640)
+++ trunk/LayoutTests/legacy-animation-engine/compositing/visible-rect/animated.html	2018-08-07 03:28:56 UTC (rev 234641)
@@ -17,6 +17,9 @@
             width: 200px;
             height: 200px;
             background-color: blue;
+        }
+        
+        .box.animating {
             -webkit-animation: move 20000000s linear;
         }
         
@@ -33,7 +36,8 @@
 
         function doTest()
         {
-            document.getElementById('animated').addEventListener('webkitAnimationStart', function() {
+            let animated = document.getElementById('animated');
+            animated.addEventListener('webkitAnimationStart', function() {
                 if (window.internals)
                     document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
 
@@ -40,6 +44,8 @@
                 if (window.testRunner)
                     testRunner.notifyDone();
             }, false);
+
+            animated.classList.add('animating');
         }
         window.addEventListener('load', doTest, false);
     </script>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to