1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webaudioeditor/test/browser_wa_graph_render_01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Tests if the shader editor shows the appropriate UI when opened. 1.9 + */ 1.10 + 1.11 +function spawnTest() { 1.12 + let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL); 1.13 + let { panelWin } = panel; 1.14 + let { gFront, $, $$, EVENTS, WebAudioParamView } = panelWin; 1.15 + let gVars = WebAudioParamView._paramsView; 1.16 + 1.17 + let started = once(gFront, "start-context"); 1.18 + 1.19 + reload(target); 1.20 + 1.21 + let [[dest, osc, gain], [[_, destID], [_, oscID], [_, gainID]]] = yield Promise.all([ 1.22 + get3(gFront, "create-node"), 1.23 + get3Spread(panelWin, EVENTS.UI_ADD_NODE_LIST), 1.24 + waitForGraphRendered(panelWin, 3, 2) 1.25 + ]); 1.26 + 1.27 + ok(findGraphNode(panelWin, oscID).classList.contains("type-OscillatorNode"), "found OscillatorNode with class"); 1.28 + ok(findGraphNode(panelWin, gainID).classList.contains("type-GainNode"), "found GainNode with class"); 1.29 + ok(findGraphNode(panelWin, destID).classList.contains("type-AudioDestinationNode"), "found AudioDestinationNode with class"); 1.30 + is(findGraphEdge(panelWin, oscID, gainID).toString(), "[object SVGGElement]", "found edge for osc -> gain"); 1.31 + is(findGraphEdge(panelWin, gainID, destID).toString(), "[object SVGGElement]", "found edge for gain -> dest"); 1.32 + 1.33 + yield teardown(panel); 1.34 + finish(); 1.35 +} 1.36 +