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(COMPLEX_CONTEXT_URL); michael@0: let { gFront, $, $$, EVENTS, WebAudioParamView } = panel.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: yield Promise.all([ michael@0: getN(gFront, "create-node", 8), michael@0: getNSpread(panel.panelWin, EVENTS.UI_ADD_NODE_LIST, 8), michael@0: waitForGraphRendered(panel.panelWin, 8, 8) michael@0: ]); michael@0: michael@0: let $items = $$(".variables-view-scope"); michael@0: let $graphNodes = $$(".nodes > g"); michael@0: michael@0: for (let $item of $items) { michael@0: mouseOver(panel.panelWin, $(".devtools-toolbar", $item)); michael@0: // Get actorID from id of variable scope michael@0: let id = $item.id.match(/\(([^\)]*)\)/)[1]; michael@0: michael@0: // Go over all graph nodes and check only the selected one is highlighted michael@0: for (let $node of $graphNodes) { michael@0: let shouldBeSelected = id === $node.getAttribute("data-id"); michael@0: ok($node.classList.contains("selected") === shouldBeSelected, michael@0: "graph node correctly " + (shouldBeSelected ? "" : "not ") + "highlighted on param view mouseover"); michael@0: } michael@0: } michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: } michael@0: