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-stepping.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-stepping.js')
-rw-r--r-- | devtools/client/canvasdebugger/test/browser_canvas-frontend-stepping.js | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/devtools/client/canvasdebugger/test/browser_canvas-frontend-stepping.js b/devtools/client/canvasdebugger/test/browser_canvas-frontend-stepping.js new file mode 100644 index 000000000..d76449b91 --- /dev/null +++ b/devtools/client/canvasdebugger/test/browser_canvas-frontend-stepping.js @@ -0,0 +1,76 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests if the stepping buttons in the call list toolbar work as advertised. + */ + +function* ifTestingSupported() { + let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL); + let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; + + yield reload(target); + + let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); + let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); + SnapshotsListView._onRecordButtonClick(); + yield promise.all([recordingFinished, callListPopulated]); + + checkSteppingButtons(1, 1, 1, 1); + is(CallsListView.selectedIndex, -1, + "There should be no selected item in the calls list view initially."); + + CallsListView._onResume(); + checkSteppingButtons(1, 1, 1, 1); + is(CallsListView.selectedIndex, 0, + "The first draw call should now be selected."); + + CallsListView._onResume(); + checkSteppingButtons(1, 1, 1, 1); + is(CallsListView.selectedIndex, 2, + "The second draw call should now be selected."); + + CallsListView._onStepOver(); + checkSteppingButtons(1, 1, 1, 1); + is(CallsListView.selectedIndex, 3, + "The next context call should now be selected."); + + CallsListView._onStepOut(); + checkSteppingButtons(0, 0, 1, 0); + is(CallsListView.selectedIndex, 7, + "The last context call should now be selected."); + + function checkSteppingButtons(resume, stepOver, stepIn, stepOut) { + if (!resume) { + is($("#resume").getAttribute("disabled"), "true", + "The resume button doesn't have the expected disabled state."); + } else { + is($("#resume").hasAttribute("disabled"), false, + "The resume button doesn't have the expected enabled state."); + } + if (!stepOver) { + is($("#step-over").getAttribute("disabled"), "true", + "The stepOver button doesn't have the expected disabled state."); + } else { + is($("#step-over").hasAttribute("disabled"), false, + "The stepOver button doesn't have the expected enabled state."); + } + if (!stepIn) { + is($("#step-in").getAttribute("disabled"), "true", + "The stepIn button doesn't have the expected disabled state."); + } else { + is($("#step-in").hasAttribute("disabled"), false, + "The stepIn button doesn't have the expected enabled state."); + } + if (!stepOut) { + is($("#step-out").getAttribute("disabled"), "true", + "The stepOut button doesn't have the expected disabled state."); + } else { + is($("#step-out").hasAttribute("disabled"), false, + "The stepOut button doesn't have the expected enabled state."); + } + } + + yield teardown(panel); + finish(); +} |