summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js')
-rw-r--r--devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js b/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js
new file mode 100644
index 000000000..011d4a086
--- /dev/null
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.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);
+
+// Test that the panel content refreshes when animations are removed.
+
+add_task(function* () {
+ yield addTab(URL_ROOT + "doc_simple_animation.html");
+
+ let {inspector, panel} = yield openAnimationInspector();
+ yield testRefreshOnRemove(inspector, panel);
+});
+
+function* testRefreshOnRemove(inspector, panel) {
+ info("Select a animated node");
+ yield selectNodeAndWaitForAnimations(".animated", inspector);
+
+ assertAnimationsDisplayed(panel, 1);
+
+ info("Listen to the next UI update event");
+ let onPanelUpdated = panel.once(panel.UI_UPDATED_EVENT);
+
+ info("Remove the animation on the node by removing the class");
+ yield executeInContent("devtools:test:setAttribute", {
+ selector: ".animated",
+ attributeName: "class",
+ attributeValue: "ball still test-node"
+ });
+
+ yield onPanelUpdated;
+ ok(true, "The panel update event was fired");
+
+ assertAnimationsDisplayed(panel, 0);
+
+ info("Add an finite animation on the node again, and wait for it to appear");
+ onPanelUpdated = panel.once(panel.UI_UPDATED_EVENT);
+ yield executeInContent("devtools:test:setAttribute", {
+ selector: ".test-node",
+ attributeName: "class",
+ attributeValue: "ball short test-node"
+ });
+ yield onPanelUpdated;
+ yield waitForAllAnimationTargets(panel);
+
+ assertAnimationsDisplayed(panel, 1);
+}