Keyframe animation doesn't 't show up in the Animations timeline
[WebKit-https.git] / LayoutTests / inspector / animation / lifecycle-css-animation.html
index 46da095..f115ccf 100644 (file)
@@ -23,10 +23,15 @@ div#target.active {
     animation-duration: 400ms;
     animation-timing-function: cubic-bezier(0.1, 0.2, 0.3, 0.4);
     animation-delay: 100ms;
-    animation-iteration-count: 2;
     animation-direction: alternate;
     animation-fill-mode: both;
 }
+div#target.active.finite {
+    animation-iteration-count: 2;
+}
+div#target.active.infinite {
+    animation-iteration-count: infinite;
+}
 </style>
 <script>
 function test()
@@ -34,20 +39,39 @@ function test()
     let suite = InspectorTest.createAsyncSuite("Animation.Lifecycle");
 
     suite.addTestCase({
-        name: "Animation.Lifecycle.CSSAnimation",
+        name: "Animation.Lifecycle.CSSAnimation.Finite",
+        description: "Check that Web Inspector is notified whenever CSS animations are created/destroyed.",
+        async test() {
+            InspectorTest.expectEqual(WI.animationManager.animationCollection.size, 0, "There should not be any animations.");
+
+            let [animation] = await Promise.all([
+                InspectorTest.AnimationLifecycleUtilities.awaitAnimationCreated(WI.Animation.Type.CSSAnimation),
+                InspectorTest.evaluateInPage(`document.getElementById("target").classList.add("active", "finite")`),
+            ]);
+
+            await Promise.all([
+                InspectorTest.AnimationLifecycleUtilities.awaitAnimationDestroyed(animation.animationId),
+                InspectorTest.AnimationLifecycleUtilities.destroyAnimations(),
+                InspectorTest.evaluateInPage(`document.getElementById("target").classList.remove("active", "finite")`),
+            ]);
+        },
+    });
+
+    suite.addTestCase({
+        name: "Animation.Lifecycle.CSSAnimation.Infinite",
         description: "Check that Web Inspector is notified whenever CSS animations are created/destroyed.",
         async test() {
             InspectorTest.expectEqual(WI.animationManager.animationCollection.size, 0, "There should not be any animations.");
 
             let [animation] = await Promise.all([
                 InspectorTest.AnimationLifecycleUtilities.awaitAnimationCreated(WI.Animation.Type.CSSAnimation),
-                InspectorTest.evaluateInPage(`document.getElementById("target").classList.add("active")`),
+                InspectorTest.evaluateInPage(`document.getElementById("target").classList.add("active", "infinite")`),
             ]);
 
             await Promise.all([
                 InspectorTest.AnimationLifecycleUtilities.awaitAnimationDestroyed(animation.animationId),
                 InspectorTest.AnimationLifecycleUtilities.destroyAnimations(),
-                InspectorTest.evaluateInPage(`document.getElementById("target").classList.remove("active")`),
+                InspectorTest.evaluateInPage(`document.getElementById("target").classList.remove("active", "infinite")`),
             ]);
         },
     });