1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Test basic communication of Web Audio actor 1.9 + */ 1.10 + 1.11 +function spawnTest () { 1.12 + let [target, debuggee, front] = yield initBackend(SIMPLE_CONTEXT_URL); 1.13 + let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = yield Promise.all([ 1.14 + front.setup({ reload: true }), 1.15 + once(front, "start-context"), 1.16 + get3(front, "create-node"), 1.17 + get2(front, "connect-node") 1.18 + ]); 1.19 + 1.20 + let destType = yield destNode.getType(); 1.21 + let oscType = yield oscNode.getType(); 1.22 + let gainType = yield gainNode.getType(); 1.23 + 1.24 + is(destType, "AudioDestinationNode", "WebAudioActor:create-node returns AudioNodeActor for AudioDestination"); 1.25 + is(oscType, "OscillatorNode", "WebAudioActor:create-node returns AudioNodeActor"); 1.26 + is(gainType, "GainNode", "WebAudioActor:create-node returns AudioNodeActor"); 1.27 + 1.28 + let { source, dest } = connect1; 1.29 + is(source.actorID, oscNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (osc->gain)"); 1.30 + is(dest.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (osc->gain)"); 1.31 + 1.32 + let { source, dest } = connect2; 1.33 + is(source.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (gain->dest)"); 1.34 + is(dest.actorID, destNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (gain->dest)"); 1.35 + 1.36 + yield removeTab(target.tab); 1.37 + finish(); 1.38 +}