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 AudioNode#isSource() michael@0: */ michael@0: michael@0: function spawnTest () { michael@0: let [target, debuggee, front] = yield initBackend(SIMPLE_NODES_URL); michael@0: let [_, nodes] = yield Promise.all([ michael@0: front.setup({ reload: true }), michael@0: getN(front, "create-node", 14) michael@0: ]); michael@0: michael@0: let actualTypes = yield Promise.all(nodes.map(node => node.getType())); michael@0: let isSourceResult = yield Promise.all(nodes.map(node => node.isSource())); michael@0: michael@0: actualTypes.forEach((type, i) => { michael@0: let shouldBeSource = type === "AudioBufferSourceNode" || type === "OscillatorNode"; michael@0: if (shouldBeSource) michael@0: is(isSourceResult[i], true, type + "'s isSource() yields into `true`"); michael@0: else michael@0: is(isSourceResult[i], false, type + "'s isSource() yields into `false`"); michael@0: }); michael@0: michael@0: yield removeTab(target.tab); michael@0: finish(); michael@0: }