browser/devtools/canvasdebugger/test/browser_canvas-frontend-call-highlight.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 certain function calls are properly highlighted in the UI.
     6  */
     8 function ifTestingSupported() {
     9   let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
    10   let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin;
    12   yield reload(target);
    14   let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
    15   let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED);
    16   SnapshotsListView._onRecordButtonClick();
    17   yield promise.all([recordingFinished, callListPopulated]);
    19   is(CallsListView.itemCount, 8,
    20     "All the function calls should now be displayed in the UI.");
    22   is($(".call-item-view", CallsListView.getItemAtIndex(0).target).hasAttribute("draw-call"), true,
    23     "The first item's node should have a draw-call attribute.");
    24   is($(".call-item-view", CallsListView.getItemAtIndex(1).target).hasAttribute("draw-call"), false,
    25     "The second item's node should not have a draw-call attribute.");
    26   is($(".call-item-view", CallsListView.getItemAtIndex(2).target).hasAttribute("draw-call"), true,
    27     "The third item's node should have a draw-call attribute.");
    28   is($(".call-item-view", CallsListView.getItemAtIndex(3).target).hasAttribute("draw-call"), false,
    29     "The fourth item's node should not have a draw-call attribute.");
    30   is($(".call-item-view", CallsListView.getItemAtIndex(4).target).hasAttribute("draw-call"), true,
    31     "The fifth item's node should have a draw-call attribute.");
    32   is($(".call-item-view", CallsListView.getItemAtIndex(5).target).hasAttribute("draw-call"), false,
    33     "The sixth item's node should not have a draw-call attribute.");
    34   is($(".call-item-view", CallsListView.getItemAtIndex(6).target).hasAttribute("draw-call"), true,
    35     "The seventh item's node should have a draw-call attribute.");
    36   is($(".call-item-view", CallsListView.getItemAtIndex(7).target).hasAttribute("draw-call"), false,
    37     "The eigth item's node should not have a draw-call attribute.");
    39   yield teardown(panel);
    40   finish();
    41 }

mercurial