summaryrefslogtreecommitdiff
path: root/toolkit/devtools/webaudioeditor/test/browser_webaudio-actor-simple.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_webaudio-actor-simple.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_webaudio-actor-simple.js')
-rw-r--r--toolkit/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/toolkit/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js b/toolkit/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js
new file mode 100644
index 000000000..949e19f0f
--- /dev/null
+++ b/toolkit/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js
@@ -0,0 +1,34 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test basic communication of Web Audio actor
+ */
+
+add_task(function*() {
+ let { target, front } = yield initBackend(SIMPLE_CONTEXT_URL);
+ let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = yield Promise.all([
+ front.setup({ reload: true }),
+ once(front, "start-context"),
+ get3(front, "create-node"),
+ get2(front, "connect-node")
+ ]);
+
+ let destType = yield destNode.getType();
+ let oscType = yield oscNode.getType();
+ let gainType = yield gainNode.getType();
+
+ is(destType, "AudioDestinationNode", "WebAudioActor:create-node returns AudioNodeActor for AudioDestination");
+ is(oscType, "OscillatorNode", "WebAudioActor:create-node returns AudioNodeActor");
+ is(gainType, "GainNode", "WebAudioActor:create-node returns AudioNodeActor");
+
+ let { source, dest } = connect1;
+ is(source.actorID, oscNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (osc->gain)");
+ is(dest.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (osc->gain)");
+
+ ({ source, dest } = connect2);
+ is(source.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (gain->dest)");
+ is(dest.actorID, destNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (gain->dest)");
+
+ yield removeTab(target.tab);
+});