Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Tests if the shader editor shows the appropriate UI when opened.
6 */
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;
13 let started = once(gFront, "start-context");
15 reload(target);
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 ]);
23 let $items = $$(".variables-view-scope");
24 let $graphNodes = $$(".nodes > g");
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];
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 });
39 yield teardown(panel);
40 finish();
41 }