Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Test basic communication of Web Audio actor |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | function spawnTest () { |
michael@0 | 9 | let [target, debuggee, front] = yield initBackend(SIMPLE_CONTEXT_URL); |
michael@0 | 10 | let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = yield Promise.all([ |
michael@0 | 11 | front.setup({ reload: true }), |
michael@0 | 12 | once(front, "start-context"), |
michael@0 | 13 | get3(front, "create-node"), |
michael@0 | 14 | get2(front, "connect-node") |
michael@0 | 15 | ]); |
michael@0 | 16 | |
michael@0 | 17 | let destType = yield destNode.getType(); |
michael@0 | 18 | let oscType = yield oscNode.getType(); |
michael@0 | 19 | let gainType = yield gainNode.getType(); |
michael@0 | 20 | |
michael@0 | 21 | is(destType, "AudioDestinationNode", "WebAudioActor:create-node returns AudioNodeActor for AudioDestination"); |
michael@0 | 22 | is(oscType, "OscillatorNode", "WebAudioActor:create-node returns AudioNodeActor"); |
michael@0 | 23 | is(gainType, "GainNode", "WebAudioActor:create-node returns AudioNodeActor"); |
michael@0 | 24 | |
michael@0 | 25 | let { source, dest } = connect1; |
michael@0 | 26 | is(source.actorID, oscNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (osc->gain)"); |
michael@0 | 27 | is(dest.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (osc->gain)"); |
michael@0 | 28 | |
michael@0 | 29 | let { source, dest } = connect2; |
michael@0 | 30 | is(source.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (gain->dest)"); |
michael@0 | 31 | is(dest.actorID, destNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (gain->dest)"); |
michael@0 | 32 | |
michael@0 | 33 | yield removeTab(target.tab); |
michael@0 | 34 | finish(); |
michael@0 | 35 | } |