summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js')
-rw-r--r--devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
new file mode 100644
index 000000000..f330e880e
--- /dev/null
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_shows_time_info.js
@@ -0,0 +1,50 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+requestLongerTimeout(2);
+
+// Check that the timeline displays animations' duration, delay iteration
+// counts and iteration start in tooltips.
+
+add_task(function* () {
+ yield addTab(URL_ROOT + "doc_simple_animation.html");
+ let {panel, controller} = yield openAnimationInspector();
+
+ info("Getting the animation element from the panel");
+ let timelineEl = panel.animationsTimelineComponent.rootWrapperEl;
+ let timeBlockNameEls = timelineEl.querySelectorAll(".time-block .name");
+
+ // Verify that each time-block's name element has a tooltip that looks sort of
+ // ok. We don't need to test the actual content.
+ [...timeBlockNameEls].forEach((el, i) => {
+ ok(el.hasAttribute("title"), "The tooltip is defined for animation " + i);
+
+ let title = el.getAttribute("title");
+ if (controller.animationPlayers[i].state.delay) {
+ ok(title.match(/Delay: [\d.-]+s/), "The tooltip shows the delay");
+ }
+ ok(title.match(/Duration: [\d.]+s/), "The tooltip shows the duration");
+ if (controller.animationPlayers[i].state.endDelay) {
+ ok(title.match(/End delay: [\d.-]+s/), "The tooltip shows the endDelay");
+ }
+ if (controller.animationPlayers[i].state.iterationCount !== 1) {
+ ok(title.match(/Repeats: /), "The tooltip shows the iterations");
+ } else {
+ ok(!title.match(/Repeats: /), "The tooltip doesn't show the iterations");
+ }
+ if (controller.animationPlayers[i].state.easing) {
+ ok(title.match(/Easing: /), "The tooltip shows the easing");
+ }
+ if (controller.animationPlayers[i].state.fill) {
+ ok(title.match(/Fill: /), "The tooltip shows the fill");
+ }
+ if (controller.animationPlayers[i].state.direction) {
+ ok(title.match(/Direction: /), "The tooltip shows the direction");
+ }
+ ok(!title.match(/Iteration start:/),
+ "The tooltip doesn't show the iteration start");
+ });
+});