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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Tests if the shader editor shows the appropriate UI when opened. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | function spawnTest() { |
michael@0 | 9 | let [target, debuggee, panel] = yield initWebAudioEditor(COMPLEX_CONTEXT_URL); |
michael@0 | 10 | let { gFront, $, $$, EVENTS, WebAudioParamView } = panel.panelWin; |
michael@0 | 11 | let gVars = WebAudioParamView._paramsView; |
michael@0 | 12 | |
michael@0 | 13 | let started = once(gFront, "start-context"); |
michael@0 | 14 | |
michael@0 | 15 | reload(target); |
michael@0 | 16 | |
michael@0 | 17 | yield Promise.all([ |
michael@0 | 18 | getN(gFront, "create-node", 8), |
michael@0 | 19 | getNSpread(panel.panelWin, EVENTS.UI_ADD_NODE_LIST, 8), |
michael@0 | 20 | waitForGraphRendered(panel.panelWin, 8, 8) |
michael@0 | 21 | ]); |
michael@0 | 22 | |
michael@0 | 23 | let $items = $$(".variables-view-scope"); |
michael@0 | 24 | let $graphNodes = $$(".nodes > g"); |
michael@0 | 25 | |
michael@0 | 26 | Array.prototype.forEach.call($items, $item => { |
michael@0 | 27 | mouseOver(panel.panelWin, $(".devtools-toolbar", $item)); |
michael@0 | 28 | // Get actorID from id of variable scope |
michael@0 | 29 | let id = $item.id.match(/\(([^\)]*)\)/)[1]; |
michael@0 | 30 | |
michael@0 | 31 | // Go over all graph nodes and check only the selected one is highlighted |
michael@0 | 32 | Array.prototype.forEach.call($graphNodes, $node => { |
michael@0 | 33 | let shouldBeSelected = id === $node.getAttribute("data-id"); |
michael@0 | 34 | ok($node.classList.contains("selected") === shouldBeSelected, |
michael@0 | 35 | "graph node correctly " + (shouldBeSelected ? "" : "not ") + "highlighted on param view mouseover"); |
michael@0 | 36 | }); |
michael@0 | 37 | }); |
michael@0 | 38 | |
michael@0 | 39 | yield teardown(panel); |
michael@0 | 40 | finish(); |
michael@0 | 41 | } |
michael@0 | 42 |