| <script src="../../resources/js-test-pre.js"></script> |
| @keyframes my-animation { |
| animation: my-animation 0.5s infinite; |
| animation-direction: alternate; |
| <p id="testElement" class="run-animation">Test text</p> |
| description("Tests that CSS animations are throttled in low power mode."); |
| const element = document.getElementById("testElement"); |
| element.onanimationstart = function() { |
| element.onanimationstart = null; |
| window.unthrottled = internals.animationsInterval; |
| window.throttled = unthrottled * 2; |
| evalAndLog("internals.setLowPowerModeEnabled(true)"); |
| shouldBe("internals.animationsInterval", "throttled"); |
| evalAndLog("internals.setLowPowerModeEnabled(false)"); |
| shouldBe("internals.animationsInterval", "unthrottled"); |
| <script src="../../resources/js-test-post.js"></script> |