browser_animation_pause-resume-button.js (1459B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test for following PauseResumeButton component: 7 // * element existence 8 // * state during running animations 9 // * state during pausing animations 10 // * make animations to pause by push button 11 // * make animations to resume by push button 12 13 add_task(async function () { 14 await addTab(URL_ROOT + "doc_custom_playback_rate.html"); 15 const { animationInspector, panel } = await openAnimationInspector(); 16 17 info("Checking pause/resume button existence"); 18 const buttonEl = panel.querySelector(".pause-resume-button"); 19 ok(buttonEl, "pause/resume button should exist"); 20 21 info("Checking state during running animations"); 22 ok( 23 !buttonEl.classList.contains("paused"), 24 "State of button should be running" 25 ); 26 27 info("Checking button makes animations to pause"); 28 clickOnPauseResumeButton(animationInspector, panel); 29 await waitUntilAnimationsPlayState(animationInspector, "paused"); 30 ok(true, "All animations are paused"); 31 ok(buttonEl.classList.contains("paused"), "State of button should be paused"); 32 33 info("Checking button makes animations to resume"); 34 clickOnPauseResumeButton(animationInspector, panel); 35 await waitUntilAnimationsPlayState(animationInspector, "running"); 36 ok(true, "All animations are running"); 37 ok( 38 !buttonEl.classList.contains("paused"), 39 "State of button should be resumed" 40 ); 41 });