summaryrefslogtreecommitdiffstats
path: root/devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js')
-rw-r--r--devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js b/devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js
new file mode 100644
index 000000000..c80082046
--- /dev/null
+++ b/devtools/client/canvasdebugger/test/browser_canvas-frontend-clear.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests if clearing the snapshots list works as expected.
+ */
+
+function* ifTestingSupported() {
+ let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL);
+ let { window, EVENTS, SnapshotsListView } = panel.panelWin;
+
+ yield reload(target);
+
+ let firstRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
+ SnapshotsListView._onRecordButtonClick();
+
+ yield firstRecordingFinished;
+ ok(true, "Finished recording a snapshot of the animation loop.");
+
+ is(SnapshotsListView.itemCount, 1,
+ "There should be one item available in the snapshots list.");
+
+ let secondRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
+ SnapshotsListView._onRecordButtonClick();
+
+ yield secondRecordingFinished;
+ ok(true, "Finished recording another snapshot of the animation loop.");
+
+ is(SnapshotsListView.itemCount, 2,
+ "There should be two items available in the snapshots list.");
+
+ let clearingFinished = once(window, EVENTS.SNAPSHOTS_LIST_CLEARED);
+ SnapshotsListView._onClearButtonClick();
+
+ yield clearingFinished;
+ ok(true, "Finished recording all snapshots.");
+
+ is(SnapshotsListView.itemCount, 0,
+ "There should be no items available in the snapshots list.");
+
+ yield teardown(panel);
+ finish();
+}