summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.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_participate_in_inspector_update.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_participate_in_inspector_update.js')
-rw-r--r--devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js b/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
new file mode 100644
index 000000000..fec529568
--- /dev/null
+++ b/devtools/client/animationinspector/test/browser_animation_participate_in_inspector_update.js
@@ -0,0 +1,46 @@
+/* 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 update of the animation panel participate in the
+// inspector-updated event. This means that the test verifies that the
+// inspector-updated event is emitted *after* the animation panel is ready.
+
+add_task(function* () {
+ yield addTab(URL_ROOT + "doc_simple_animation.html");
+ let {inspector, panel, controller} = yield openAnimationInspector();
+
+ info("Listen for the players-updated, ui-updated and " +
+ "inspector-updated events");
+ let receivedEvents = [];
+ controller.once(controller.PLAYERS_UPDATED_EVENT, () => {
+ receivedEvents.push(controller.PLAYERS_UPDATED_EVENT);
+ });
+ panel.once(panel.UI_UPDATED_EVENT, () => {
+ receivedEvents.push(panel.UI_UPDATED_EVENT);
+ });
+ inspector.once("inspector-updated", () => {
+ receivedEvents.push("inspector-updated");
+ });
+
+ info("Selecting an animated node");
+ let node = yield getNodeFront(".animated", inspector);
+ yield selectNodeAndWaitForAnimations(node, inspector);
+
+ info("Check that all events were received");
+ // Only assert that the inspector-updated event is last, the order of the
+ // first 2 events is irrelevant.
+
+ is(receivedEvents.length, 3, "3 events were received");
+ is(receivedEvents[2], "inspector-updated",
+ "The third event received was the inspector-updated event");
+
+ ok(receivedEvents.indexOf(controller.PLAYERS_UPDATED_EVENT) !== -1,
+ "The players-updated event was received");
+ ok(receivedEvents.indexOf(panel.UI_UPDATED_EVENT) !== -1,
+ "The ui-updated event was received");
+});