summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_refresh_when_active.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_refresh_when_active.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_refresh_when_active.js')
-rw-r--r--devtools/client/animationinspector/test/browser_animation_refresh_when_active.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js b/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
new file mode 100644
index 000000000..6fb244b1e
--- /dev/null
+++ b/devtools/client/animationinspector/test/browser_animation_refresh_when_active.js
@@ -0,0 +1,53 @@
+/* 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 only refreshes when it is visible in the sidebar.
+
+add_task(function* () {
+ yield addTab(URL_ROOT + "doc_simple_animation.html");
+
+ let {inspector, panel} = yield openAnimationInspector();
+ yield testRefresh(inspector, panel);
+});
+
+function* testRefresh(inspector, panel) {
+ info("Select a non animated node");
+ yield selectNodeAndWaitForAnimations(".still", inspector);
+
+ info("Switch to the rule-view panel");
+ inspector.sidebar.select("ruleview");
+
+ info("Select the animated node now");
+ yield selectNodeAndWaitForAnimations(".animated", inspector);
+
+ assertAnimationsDisplayed(panel, 0,
+ "The panel doesn't show the animation data while inactive");
+
+ info("Switch to the animation panel");
+ inspector.sidebar.select("animationinspector");
+ yield panel.once(panel.UI_UPDATED_EVENT);
+
+ assertAnimationsDisplayed(panel, 1,
+ "The panel shows the animation data after selecting it");
+
+ info("Switch again to the rule-view");
+ inspector.sidebar.select("ruleview");
+
+ info("Select the non animated node again");
+ yield selectNodeAndWaitForAnimations(".still", inspector);
+
+ assertAnimationsDisplayed(panel, 1,
+ "The panel still shows the previous animation data since it is inactive");
+
+ info("Switch to the animation panel again");
+ inspector.sidebar.select("animationinspector");
+ yield panel.once(panel.UI_UPDATED_EVENT);
+
+ assertAnimationsDisplayed(panel, 0,
+ "The panel is now empty after refreshing");
+}