Bug 1454392 - Part 5: Add test whether proper currentTime was set for each animations. r?pbro
MozReview-Commit-ID: 9qUNhRMCy7Q
--- a/devtools/client/inspector/animation/test/browser.ini
+++ b/devtools/client/inspector/animation/test/browser.ini
@@ -26,16 +26,17 @@ support-files =
[browser_animation_animation-list.js]
[browser_animation_animation-target.js]
[browser_animation_animation-target_highlight.js]
[browser_animation_animation-target_select.js]
[browser_animation_animation-timeline-tick.js]
[browser_animation_css-transition-with-playstate-idle.js]
[browser_animation_current-time-label.js]
[browser_animation_current-time-scrubber.js]
+[browser_animation_current-time-scrubber_each-different-creation-time-animations.js]
[browser_animation_empty_on_invalid_nodes.js]
[browser_animation_inspector_exists.js]
[browser_animation_keyframes-graph_computed-value-path.js]
[browser_animation_keyframes-graph_computed-value-path_easing-hint.js]
[browser_animation_keyframes-graph_keyframe-marker.js]
[browser_animation_keyframes-progress-bar.js]
[browser_animation_logic_auto-stop.js]
[browser_animation_logic_avoid-updating-during-hiding.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/animation/test/browser_animation_current-time-scrubber_each-different-creation-time-animations.js
@@ -0,0 +1,27 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test whether proper currentTime was set for each animations.
+
+const WAIT_TIME = 3000;
+
+add_task(async function() {
+ await addTab(URL_ROOT + "doc_simple_animation.html");
+ await removeAnimatedElementsExcept([".animated", ".still"]);
+ const { animationInspector, panel } = await openAnimationInspector();
+
+ info("Add an animation to make a situation which has different creation time");
+ await wait(WAIT_TIME);
+ await setClassAttribute(animationInspector, ".still", "ball compositor-all");
+
+ info("Move the scrubber");
+ await clickOnCurrentTimeScrubberController(animationInspector, panel, 0.5);
+
+ info("Check existed animations have different currentTime");
+ const animations = animationInspector.state.animations;
+ ok(animations[0].state.currentTime + WAIT_TIME > animations[1].state.currentTime,
+ `The currentTime of added animation shold be ${ WAIT_TIME }ms less than ` +
+ "at least that currentTime of first animation");
+});