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: * Tests if the shader editor shows the appropriate UI when opened. michael@0: */ michael@0: michael@0: function spawnTest() { michael@0: let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL); michael@0: let { panelWin } = panel; michael@0: let { gFront, $, $$, EVENTS, WebAudioParamView } = panelWin; michael@0: let gVars = WebAudioParamView._paramsView; michael@0: michael@0: let started = once(gFront, "start-context"); michael@0: michael@0: reload(target); michael@0: michael@0: let [[dest, osc, gain], [[_, destID], [_, oscID], [_, gainID]]] = yield Promise.all([ michael@0: get3(gFront, "create-node"), michael@0: get3Spread(panelWin, EVENTS.UI_ADD_NODE_LIST), michael@0: waitForGraphRendered(panelWin, 3, 2) michael@0: ]); michael@0: michael@0: ok(findGraphNode(panelWin, oscID).classList.contains("type-OscillatorNode"), "found OscillatorNode with class"); michael@0: ok(findGraphNode(panelWin, gainID).classList.contains("type-GainNode"), "found GainNode with class"); michael@0: ok(findGraphNode(panelWin, destID).classList.contains("type-AudioDestinationNode"), "found AudioDestinationNode with class"); michael@0: is(findGraphEdge(panelWin, oscID, gainID).toString(), "[object SVGGElement]", "found edge for osc -> gain"); michael@0: is(findGraphEdge(panelWin, gainID, destID).toString(), "[object SVGGElement]", "found edge for gain -> dest"); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: } michael@0: