diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/canvasdebugger/test/browser_canvas-frontend-record-01.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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-record-01.js')
-rw-r--r-- | devtools/client/canvasdebugger/test/browser_canvas-frontend-record-01.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/devtools/client/canvasdebugger/test/browser_canvas-frontend-record-01.js b/devtools/client/canvasdebugger/test/browser_canvas-frontend-record-01.js new file mode 100644 index 000000000..cd0358d3c --- /dev/null +++ b/devtools/client/canvasdebugger/test/browser_canvas-frontend-record-01.js @@ -0,0 +1,60 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests whether the frontend behaves correctly while reording a snapshot. + */ + +function* ifTestingSupported() { + let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL); + let { window, EVENTS, $, SnapshotsListView } = panel.panelWin; + + yield reload(target); + + is($("#record-snapshot").hasAttribute("checked"), false, + "The 'record snapshot' button should initially be unchecked."); + is($("#record-snapshot").hasAttribute("disabled"), false, + "The 'record snapshot' button should initially be enabled."); + is($("#record-snapshot").hasAttribute("hidden"), false, + "The 'record snapshot' button should now be visible."); + + is(SnapshotsListView.itemCount, 0, + "There should be no items available in the snapshots list view."); + is(SnapshotsListView.selectedIndex, -1, + "There should be no selected item in the snapshots list view."); + + let recordingStarted = once(window, EVENTS.SNAPSHOT_RECORDING_STARTED); + let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); + SnapshotsListView._onRecordButtonClick(); + + yield recordingStarted; + ok(true, "Started recording a snapshot of the animation loop."); + + is($("#record-snapshot").getAttribute("checked"), "true", + "The 'record snapshot' button should now be checked."); + is($("#record-snapshot").hasAttribute("hidden"), false, + "The 'record snapshot' button should still be visible."); + + is(SnapshotsListView.itemCount, 1, + "There should be one item available in the snapshots list view now."); + is(SnapshotsListView.selectedIndex, -1, + "There should be no selected item in the snapshots list view yet."); + + yield recordingFinished; + ok(true, "Finished recording a snapshot of the animation loop."); + + is($("#record-snapshot").hasAttribute("checked"), false, + "The 'record snapshot' button should now be unchecked."); + is($("#record-snapshot").hasAttribute("disabled"), false, + "The 'record snapshot' button should now be re-enabled."); + is($("#record-snapshot").hasAttribute("hidden"), false, + "The 'record snapshot' button should still be visible."); + + is(SnapshotsListView.itemCount, 1, + "There should still be only one item available in the snapshots list view."); + is(SnapshotsListView.selectedIndex, 0, + "There should be one selected item in the snapshots list view now."); + + yield teardown(panel); + finish(); +} |