summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.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/debugger/new/test/mochitest/browser_dbg-call-stack.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/debugger/new/test/mochitest/browser_dbg-call-stack.js')
-rw-r--r--devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js
new file mode 100644
index 000000000..54a401eeb
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// checks to see if the frame is selected and the title is correct
+function isFrameSelected(dbg, index, title) {
+ const $frame = findElement(dbg, "frame", index);
+ const frame = dbg.selectors.getSelectedFrame(dbg.getState());
+
+ const elSelected = $frame.classList.contains("selected");
+ const titleSelected = frame.displayName == title;
+
+ return elSelected && titleSelected;
+}
+
+function toggleButton(dbg) {
+ const callStackBody = findElement(dbg, "callStackBody");
+ return callStackBody.querySelector(".show-more");
+}
+
+add_task(function* () {
+ const dbg = yield initDebugger("doc-script-switching.html");
+
+ toggleCallStack(dbg);
+
+ const notPaused = findElement(dbg, "callStackBody").innerText;
+ is(notPaused, "Not Paused", "Not paused message is shown");
+
+ invokeInTab("firstCall");
+ yield waitForPaused(dbg);
+
+ ok(isFrameSelected(dbg, 1, "secondCall"), "the first frame is selected");
+
+ clickElement(dbg, "frame", 2);
+ ok(isFrameSelected(dbg, 2, "firstCall"), "the second frame is selected");
+
+ let button = toggleButton(dbg);
+ ok(!button, "toggle button shouldn't be there");
+});
+
+add_task(function* () {
+ const dbg = yield initDebugger("doc-frames.html");
+
+ toggleCallStack(dbg);
+
+ invokeInTab("startRecursion");
+ yield waitForPaused(dbg);
+
+ ok(isFrameSelected(dbg, 1, "recurseA"), "the first frame is selected");
+
+ // check to make sure that the toggle button isn't there
+ let button = toggleButton(dbg);
+ let frames = findAllElements(dbg, "frames");
+ is(button.innerText, "Expand Rows", "toggle button should be expand");
+ is(frames.length, 7, "There should be at most seven frames");
+
+ button.click();
+
+ button = toggleButton(dbg);
+ frames = findAllElements(dbg, "frames");
+ is(button.innerText, "Collapse Rows", "toggle button should be collapse");
+ is(frames.length, 22, "All of the frames should be shown");
+});