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.

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

mercurial