michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Test basic communication of Web Audio actor michael@0: */ michael@0: michael@0: function spawnTest () { michael@0: let [target, debuggee, front] = yield initBackend(SIMPLE_CONTEXT_URL); michael@0: let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = yield Promise.all([ michael@0: front.setup({ reload: true }), michael@0: once(front, "start-context"), michael@0: get3(front, "create-node"), michael@0: get2(front, "connect-node") michael@0: ]); michael@0: michael@0: let destType = yield destNode.getType(); michael@0: let oscType = yield oscNode.getType(); michael@0: let gainType = yield gainNode.getType(); michael@0: michael@0: is(destType, "AudioDestinationNode", "WebAudioActor:create-node returns AudioNodeActor for AudioDestination"); michael@0: is(oscType, "OscillatorNode", "WebAudioActor:create-node returns AudioNodeActor"); michael@0: is(gainType, "GainNode", "WebAudioActor:create-node returns AudioNodeActor"); michael@0: michael@0: let { source, dest } = connect1; michael@0: is(source.actorID, oscNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (osc->gain)"); michael@0: is(dest.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (osc->gain)"); michael@0: michael@0: let { source, dest } = connect2; michael@0: is(source.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (gain->dest)"); michael@0: is(dest.actorID, destNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (gain->dest)"); michael@0: michael@0: yield removeTab(target.tab); michael@0: finish(); michael@0: }