summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.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_spacebar_toggles_node_animations.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_spacebar_toggles_node_animations.js')
-rw-r--r--devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js b/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js
new file mode 100644
index 000000000..634d4bc49
--- /dev/null
+++ b/devtools/client/animationinspector/test/browser_animation_spacebar_toggles_node_animations.js
@@ -0,0 +1,45 @@
+/* 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";
+
+// Test that the spacebar key press toggles the play/resume button state.
+// This test doesn't need to test if animations actually pause/resume
+// because there's an other test that does this.
+// There are animations in the test page and since, by default, the <body> node
+// is selected, animations will be displayed in the timeline, so the timeline
+// play/resume button will be displayed
+
+requestLongerTimeout(2);
+
+add_task(function* () {
+ requestLongerTimeout(2);
+
+ yield addTab(URL_ROOT + "doc_simple_animation.html");
+ let {panel, window} = yield openAnimationInspector();
+ let {playTimelineButtonEl} = panel;
+
+ // ensure the focus is on the animation panel
+ window.focus();
+
+ info("Simulate spacebar stroke and check playResume button" +
+ " is in paused state");
+
+ // sending the key will lead to a UI_UPDATE_EVENT
+ let onUpdated = panel.once(panel.UI_UPDATED_EVENT);
+ EventUtils.sendKey("SPACE", window);
+ yield onUpdated;
+ ok(playTimelineButtonEl.classList.contains("paused"),
+ "The play/resume button is in its paused state");
+
+ info("Simulate spacebar stroke and check playResume button" +
+ " is in playing state");
+
+ // sending the key will lead to a UI_UPDATE_EVENT
+ onUpdated = panel.once(panel.UI_UPDATED_EVENT);
+ EventUtils.sendKey("SPACE", window);
+ yield onUpdated;
+ ok(!playTimelineButtonEl.classList.contains("paused"),
+ "The play/resume button is in its play state again");
+});