|
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(COMPLEX_CONTEXT_URL); |
|
10 let { gFront, $, $$, EVENTS, WebAudioParamView } = panel.panelWin; |
|
11 let gVars = WebAudioParamView._paramsView; |
|
12 |
|
13 let started = once(gFront, "start-context"); |
|
14 |
|
15 reload(target); |
|
16 |
|
17 yield Promise.all([ |
|
18 getN(gFront, "create-node", 8), |
|
19 getNSpread(panel.panelWin, EVENTS.UI_ADD_NODE_LIST, 8), |
|
20 waitForGraphRendered(panel.panelWin, 8, 8) |
|
21 ]); |
|
22 |
|
23 let $items = $$(".variables-view-scope"); |
|
24 let $graphNodes = $$(".nodes > g"); |
|
25 |
|
26 Array.prototype.forEach.call($items, $item => { |
|
27 mouseOver(panel.panelWin, $(".devtools-toolbar", $item)); |
|
28 // Get actorID from id of variable scope |
|
29 let id = $item.id.match(/\(([^\)]*)\)/)[1]; |
|
30 |
|
31 // Go over all graph nodes and check only the selected one is highlighted |
|
32 Array.prototype.forEach.call($graphNodes, $node => { |
|
33 let shouldBeSelected = id === $node.getAttribute("data-id"); |
|
34 ok($node.classList.contains("selected") === shouldBeSelected, |
|
35 "graph node correctly " + (shouldBeSelected ? "" : "not ") + "highlighted on param view mouseover"); |
|
36 }); |
|
37 }); |
|
38 |
|
39 yield teardown(panel); |
|
40 finish(); |
|
41 } |
|
42 |