1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webaudioeditor/test/browser_wa_params_view_mouseover.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Tests if the shader editor shows the appropriate UI when opened. 1.9 + */ 1.10 + 1.11 +function spawnTest() { 1.12 + let [target, debuggee, panel] = yield initWebAudioEditor(COMPLEX_CONTEXT_URL); 1.13 + let { gFront, $, $$, EVENTS, WebAudioParamView } = panel.panelWin; 1.14 + let gVars = WebAudioParamView._paramsView; 1.15 + 1.16 + let started = once(gFront, "start-context"); 1.17 + 1.18 + reload(target); 1.19 + 1.20 + yield Promise.all([ 1.21 + getN(gFront, "create-node", 8), 1.22 + getNSpread(panel.panelWin, EVENTS.UI_ADD_NODE_LIST, 8), 1.23 + waitForGraphRendered(panel.panelWin, 8, 8) 1.24 + ]); 1.25 + 1.26 + let $items = $$(".variables-view-scope"); 1.27 + let $graphNodes = $$(".nodes > g"); 1.28 + 1.29 + Array.prototype.forEach.call($items, $item => { 1.30 + mouseOver(panel.panelWin, $(".devtools-toolbar", $item)); 1.31 + // Get actorID from id of variable scope 1.32 + let id = $item.id.match(/\(([^\)]*)\)/)[1]; 1.33 + 1.34 + // Go over all graph nodes and check only the selected one is highlighted 1.35 + Array.prototype.forEach.call($graphNodes, $node => { 1.36 + let shouldBeSelected = id === $node.getAttribute("data-id"); 1.37 + ok($node.classList.contains("selected") === shouldBeSelected, 1.38 + "graph node correctly " + (shouldBeSelected ? "" : "not ") + "highlighted on param view mouseover"); 1.39 + }); 1.40 + }); 1.41 + 1.42 + yield teardown(panel); 1.43 + finish(); 1.44 +} 1.45 +