browser_animation_logic_created-time.js (1691B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test whether the created time of animation unchanged even if change node. 7 8 add_task(async function () { 9 await addTab(URL_ROOT + "doc_custom_playback_rate.html"); 10 const { animationInspector, inspector } = await openAnimationInspector(); 11 12 info("Check both the created time of animation are same"); 13 const baseCreatedTime = 14 animationInspector.state.animations[0].state.createdTime; 15 is( 16 animationInspector.state.animations[1].state.createdTime, 17 baseCreatedTime, 18 "Both created time of animations should be same" 19 ); 20 21 info("Check created time after selecting '.div1'"); 22 await selectNode(".div1", inspector); 23 await waitUntil( 24 () => 25 animationInspector.state.animations[0].state.createdTime === 26 baseCreatedTime 27 ); 28 ok( 29 true, 30 "The created time of animation on element of .div1 should unchanged" 31 ); 32 33 info("Check created time after selecting '.div2'"); 34 await selectNode(".div2", inspector); 35 await waitUntil( 36 () => 37 animationInspector.state.animations[0].state.createdTime === 38 baseCreatedTime 39 ); 40 ok( 41 true, 42 "The created time of animation on element of .div2 should unchanged" 43 ); 44 45 info("Check created time after selecting 'body' again"); 46 await selectNode("body", inspector); 47 is( 48 animationInspector.state.animations[0].state.createdTime, 49 baseCreatedTime, 50 "The created time of animation[0] should unchanged" 51 ); 52 is( 53 animationInspector.state.animations[1].state.createdTime, 54 baseCreatedTime, 55 "The created time of animation[1] should unchanged" 56 ); 57 });