browser/devtools/webaudioeditor/test/browser_wa_graph_mouseover.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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   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];
    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   }
    39   yield teardown(panel);
    40   finish();
    41 }

mercurial