| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| <script src="resources/lifecycle-utilities.js"></script> |
| transition-property: opacity; |
| transition-duration: 400ms; |
| transition-timing-function: cubic-bezier(0.1, 0.2, 0.3, 0.4); |
| let suite = InspectorTest.createAsyncSuite("Animation.Lifecycle"); |
| name: "Animation.Lifecycle.CSSTransition", |
| description: "Check that Web Inspector is notified whenever CSS transitions are created/destroyed.", |
| InspectorTest.expectEqual(WI.animationManager.animationCollection.size, 0, "There should not be any animations."); |
| let [animation] = await Promise.all([ |
| InspectorTest.AnimationLifecycleUtilities.awaitAnimationCreated(WI.Animation.Type.CSSTransition), |
| InspectorTest.evaluateInPage(`document.getElementById("target").classList.add("active")`), |
| InspectorTest.AnimationLifecycleUtilities.awaitAnimationDestroyed(animation.animationId), |
| InspectorTest.AnimationLifecycleUtilities.destroyAnimations(), |
| InspectorTest.evaluateInPage(`document.getElementById("target").classList.remove("active")`), |
| suite.runTestCasesAndFinish(); |
| <body onload="runTest()"> |
| <p>Tests for the Animation.animationCreated and Animation.animationDestroyed events.</p> |