browser/devtools/webaudioeditor/test/browser_wa_params_view_mouseover.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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 }

mercurial