browser/devtools/canvasdebugger/test/browser_canvas-frontend-clear.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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