browser/devtools/webaudioeditor/test/browser_wa_graph_mouseover.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:3b0a3cd26fa5
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 for (let $item of $items) {
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 for (let $node of $graphNodes) {
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

mercurial