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-reload-02.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-reload-02.js')
-rw-r--r-- | devtools/client/canvasdebugger/test/browser_canvas-frontend-reload-02.js | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/devtools/client/canvasdebugger/test/browser_canvas-frontend-reload-02.js b/devtools/client/canvasdebugger/test/browser_canvas-frontend-reload-02.js new file mode 100644 index 000000000..2747fd13f --- /dev/null +++ b/devtools/client/canvasdebugger/test/browser_canvas-frontend-reload-02.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests that the frontend UI is properly reconfigured after reloading. + */ + +function* ifTestingSupported() { + let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL); + let { window, $, $all, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; + + is(SnapshotsListView.itemCount, 0, + "There should be no snapshots initially displayed in the UI."); + is(CallsListView.itemCount, 0, + "There should be no function calls initially displayed in the UI."); + + is($("#screenshot-container").hidden, true, + "The screenshot should not be initially displayed in the UI."); + is($("#snapshot-filmstrip").hidden, true, + "There should be no thumbnails initially displayed in the UI (1)."); + is($all(".filmstrip-thumbnail").length, 0, + "There should be no thumbnails initially displayed in the UI (2)."); + + yield reload(target); + + let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); + let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); + let thumbnailsDisplayed = once(window, EVENTS.THUMBNAILS_DISPLAYED); + let screenshotDisplayed = once(window, EVENTS.CALL_SCREENSHOT_DISPLAYED); + SnapshotsListView._onRecordButtonClick(); + yield promise.all([ + recordingFinished, + callListPopulated, + thumbnailsDisplayed, + screenshotDisplayed + ]); + + is(SnapshotsListView.itemCount, 1, + "There should be one snapshot displayed in the UI."); + is(CallsListView.itemCount, 8, + "All the function calls should now be displayed in the UI."); + + is($("#screenshot-container").hidden, false, + "The screenshot should now be displayed in the UI."); + is($("#snapshot-filmstrip").hidden, false, + "All the thumbnails should now be displayed in the UI (1)."); + is($all(".filmstrip-thumbnail").length, 4, + "All the thumbnails should now be displayed in the UI (2)."); + + let reset = once(window, EVENTS.UI_RESET); + let navigated = reload(target); + + yield reset; + ok(true, "The UI was reset after the refresh button was clicked."); + + is(SnapshotsListView.itemCount, 0, + "There should be no snapshots displayed in the UI after navigating."); + is(CallsListView.itemCount, 0, + "There should be no function calls displayed in the UI after navigating."); + is($("#snapshot-filmstrip").hidden, true, + "There should be no thumbnails displayed in the UI after navigating."); + is($("#screenshot-container").hidden, true, + "The screenshot should not be displayed in the UI after navigating."); + + yield navigated; + ok(true, "The target finished reloading."); + + yield teardown(panel); + finish(); +} |