|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Tests if the shader editor shows the appropriate UI when opened. |
|
6 */ |
|
7 |
|
8 function spawnTest() { |
|
9 let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL); |
|
10 let { panelWin } = panel; |
|
11 let { gFront, $, $$, EVENTS, WebAudioParamView } = panelWin; |
|
12 let gVars = WebAudioParamView._paramsView; |
|
13 |
|
14 let started = once(gFront, "start-context"); |
|
15 |
|
16 reload(target); |
|
17 |
|
18 let [[dest, osc, gain], [[_, destID], [_, oscID], [_, gainID]]] = yield Promise.all([ |
|
19 get3(gFront, "create-node"), |
|
20 get3Spread(panelWin, EVENTS.UI_ADD_NODE_LIST), |
|
21 waitForGraphRendered(panelWin, 3, 2) |
|
22 ]); |
|
23 |
|
24 ok(findGraphNode(panelWin, oscID).classList.contains("type-OscillatorNode"), "found OscillatorNode with class"); |
|
25 ok(findGraphNode(panelWin, gainID).classList.contains("type-GainNode"), "found GainNode with class"); |
|
26 ok(findGraphNode(panelWin, destID).classList.contains("type-AudioDestinationNode"), "found AudioDestinationNode with class"); |
|
27 is(findGraphEdge(panelWin, oscID, gainID).toString(), "[object SVGGElement]", "found edge for osc -> gain"); |
|
28 is(findGraphEdge(panelWin, gainID, destID).toString(), "[object SVGGElement]", "found edge for gain -> dest"); |
|
29 |
|
30 yield teardown(panel); |
|
31 finish(); |
|
32 } |
|
33 |