browser/devtools/webaudioeditor/test/browser_webaudio-actor-simple.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Test basic communication of Web Audio actor
     6  */
     8 function spawnTest () {
     9   let [target, debuggee, front] = yield initBackend(SIMPLE_CONTEXT_URL);
    10   let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = yield Promise.all([
    11     front.setup({ reload: true }),
    12     once(front, "start-context"),
    13     get3(front, "create-node"),
    14     get2(front, "connect-node")
    15   ]);
    17   let destType = yield destNode.getType();
    18   let oscType = yield oscNode.getType();
    19   let gainType = yield gainNode.getType();
    21   is(destType, "AudioDestinationNode", "WebAudioActor:create-node returns AudioNodeActor for AudioDestination");
    22   is(oscType, "OscillatorNode", "WebAudioActor:create-node returns AudioNodeActor");
    23   is(gainType, "GainNode", "WebAudioActor:create-node returns AudioNodeActor");
    25   let { source, dest } = connect1;
    26   is(source.actorID, oscNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (osc->gain)");
    27   is(dest.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (osc->gain)");
    29   let { source, dest } = connect2;
    30   is(source.actorID, gainNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on source (gain->dest)");
    31   is(dest.actorID, destNode.actorID, "WebAudioActor:connect-node returns correct actor with ID on dest (gain->dest)");
    33   yield removeTab(target.tab);
    34   finish();
    35 }

mercurial