Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 | * Tests if the shader editor shows the appropriate UI when opened. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | function spawnTest() { |
michael@0 | 9 | let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL); |
michael@0 | 10 | let { panelWin } = panel; |
michael@0 | 11 | let { gFront, $, $$, EVENTS, WebAudioParamView } = panelWin; |
michael@0 | 12 | let gVars = WebAudioParamView._paramsView; |
michael@0 | 13 | |
michael@0 | 14 | let started = once(gFront, "start-context"); |
michael@0 | 15 | |
michael@0 | 16 | reload(target); |
michael@0 | 17 | |
michael@0 | 18 | let [[dest, osc, gain], [[_, destID], [_, oscID], [_, gainID]]] = yield Promise.all([ |
michael@0 | 19 | get3(gFront, "create-node"), |
michael@0 | 20 | get3Spread(panelWin, EVENTS.UI_ADD_NODE_LIST), |
michael@0 | 21 | waitForGraphRendered(panelWin, 3, 2) |
michael@0 | 22 | ]); |
michael@0 | 23 | |
michael@0 | 24 | ok(findGraphNode(panelWin, oscID).classList.contains("type-OscillatorNode"), "found OscillatorNode with class"); |
michael@0 | 25 | ok(findGraphNode(panelWin, gainID).classList.contains("type-GainNode"), "found GainNode with class"); |
michael@0 | 26 | ok(findGraphNode(panelWin, destID).classList.contains("type-AudioDestinationNode"), "found AudioDestinationNode with class"); |
michael@0 | 27 | is(findGraphEdge(panelWin, oscID, gainID).toString(), "[object SVGGElement]", "found edge for osc -> gain"); |
michael@0 | 28 | is(findGraphEdge(panelWin, gainID, destID).toString(), "[object SVGGElement]", "found edge for gain -> dest"); |
michael@0 | 29 | |
michael@0 | 30 | yield teardown(panel); |
michael@0 | 31 | finish(); |
michael@0 | 32 | } |
michael@0 | 33 |