michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if clearing the snapshots list works as expected. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, EVENTS, SnapshotsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let firstRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: michael@0: yield firstRecordingFinished; michael@0: ok(true, "Finished recording a snapshot of the animation loop."); michael@0: michael@0: is(SnapshotsListView.itemCount, 1, michael@0: "There should be one item available in the snapshots list."); michael@0: michael@0: let secondRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: michael@0: yield secondRecordingFinished; michael@0: ok(true, "Finished recording another snapshot of the animation loop."); michael@0: michael@0: is(SnapshotsListView.itemCount, 2, michael@0: "There should be two items available in the snapshots list."); michael@0: michael@0: let clearingFinished = once(window, EVENTS.SNAPSHOTS_LIST_CLEARED); michael@0: SnapshotsListView._onClearButtonClick(); michael@0: michael@0: yield clearingFinished; michael@0: ok(true, "Finished recording all snapshots."); michael@0: michael@0: is(SnapshotsListView.itemCount, 0, michael@0: "There should be no items available in the snapshots list."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }