browser/devtools/canvasdebugger/test/browser_canvas-frontend-clear.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 clearing the snapshots list works as expected.
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 } = panel.panelWin;
michael@0 11
michael@0 12 yield reload(target);
michael@0 13
michael@0 14 let firstRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
michael@0 15 SnapshotsListView._onRecordButtonClick();
michael@0 16
michael@0 17 yield firstRecordingFinished;
michael@0 18 ok(true, "Finished recording a snapshot of the animation loop.");
michael@0 19
michael@0 20 is(SnapshotsListView.itemCount, 1,
michael@0 21 "There should be one item available in the snapshots list.");
michael@0 22
michael@0 23 let secondRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
michael@0 24 SnapshotsListView._onRecordButtonClick();
michael@0 25
michael@0 26 yield secondRecordingFinished;
michael@0 27 ok(true, "Finished recording another snapshot of the animation loop.");
michael@0 28
michael@0 29 is(SnapshotsListView.itemCount, 2,
michael@0 30 "There should be two items available in the snapshots list.");
michael@0 31
michael@0 32 let clearingFinished = once(window, EVENTS.SNAPSHOTS_LIST_CLEARED);
michael@0 33 SnapshotsListView._onClearButtonClick();
michael@0 34
michael@0 35 yield clearingFinished;
michael@0 36 ok(true, "Finished recording all snapshots.");
michael@0 37
michael@0 38 is(SnapshotsListView.itemCount, 0,
michael@0 39 "There should be no items available in the snapshots list.");
michael@0 40
michael@0 41 yield teardown(panel);
michael@0 42 finish();
michael@0 43 }

mercurial