browser/devtools/canvasdebugger/test/browser_canvas-frontend-record-03.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 whether the frontend displays the correct info for a snapshot
michael@0 6 * after finishing recording.
michael@0 7 */
michael@0 8
michael@0 9 function ifTestingSupported() {
michael@0 10 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
michael@0 11 let { window, EVENTS, $, SnapshotsListView } = panel.panelWin;
michael@0 12
michael@0 13 yield reload(target);
michael@0 14
michael@0 15 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
michael@0 16 SnapshotsListView._onRecordButtonClick();
michael@0 17
michael@0 18 yield recordingFinished;
michael@0 19 ok(true, "Finished recording a snapshot of the animation loop.");
michael@0 20
michael@0 21 let item = SnapshotsListView.getItemAtIndex(0);
michael@0 22
michael@0 23 is(SnapshotsListView.selectedItem, item,
michael@0 24 "The first item should now be selected in the snapshots list view (1).");
michael@0 25 is(SnapshotsListView.selectedIndex, 0,
michael@0 26 "The first item should now be selected in the snapshots list view (2).");
michael@0 27
michael@0 28 is($(".snapshot-item-calls", item.target).getAttribute("value"), "4 draws, 8 calls",
michael@0 29 "The placeholder item's calls label is correct.");
michael@0 30 is($(".snapshot-item-save", item.target).getAttribute("value"), "Save",
michael@0 31 "The placeholder item's save label is correct.");
michael@0 32 is($(".snapshot-item-save", item.target).getAttribute("disabled"), "false",
michael@0 33 "The placeholder item's save label should be clickable.");
michael@0 34
michael@0 35 yield teardown(panel);
michael@0 36 finish();
michael@0 37 }

mercurial