summaryrefslogtreecommitdiff
path: root/toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
committerMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
commit81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch)
tree6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js
parent28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff)
downloadpalemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js')
-rw-r--r--toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js b/toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js
new file mode 100644
index 000000000..4ee7e04fe
--- /dev/null
+++ b/toolkit/devtools/webaudioeditor/test/browser_wa_graph-selected.js
@@ -0,0 +1,50 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests that SVG nodes and edges were created for the Graph View.
+ */
+
+add_task(function*() {
+ let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
+ let { panelWin } = panel;
+ let { gFront, $, $$, EVENTS } = panelWin;
+
+ let started = once(gFront, "start-context");
+
+ reload(target);
+
+ let [actors] = yield Promise.all([
+ get3(gFront, "create-node"),
+ waitForGraphRendered(panelWin, 3, 2)
+ ]);
+
+ let [destId, oscId, gainId] = actors.map(actor => actor.actorID);
+
+ ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
+ "No nodes selected on start. (destination)");
+ ok(!findGraphNode(panelWin, oscId).classList.contains("selected"),
+ "No nodes selected on start. (oscillator)");
+ ok(!findGraphNode(panelWin, gainId).classList.contains("selected"),
+ "No nodes selected on start. (gain)");
+
+ yield clickGraphNode(panelWin, oscId);
+
+ ok(findGraphNode(panelWin, oscId).classList.contains("selected"),
+ "Selected node has class 'selected'.");
+ ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
+ "Non-selected nodes do not have class 'selected'.");
+ ok(!findGraphNode(panelWin, gainId).classList.contains("selected"),
+ "Non-selected nodes do not have class 'selected'.");
+
+ yield clickGraphNode(panelWin, gainId);
+
+ ok(!findGraphNode(panelWin, oscId).classList.contains("selected"),
+ "Previously selected node no longer has class 'selected'.");
+ ok(!findGraphNode(panelWin, destId).classList.contains("selected"),
+ "Non-selected nodes do not have class 'selected'.");
+ ok(findGraphNode(panelWin, gainId).classList.contains("selected"),
+ "Newly selected node now has class 'selected'.");
+
+ yield teardown(target);
+});