browser/devtools/debugger/test/browser_dbg_stack-01.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Test that stackframes are added when debugger is paused.
     6  */
     8 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
    10 let gTab, gDebuggee, gPanel, gDebugger;
    11 let gFrames, gClassicFrames;
    13 function test() {
    14   initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
    15     gTab = aTab;
    16     gDebuggee = aDebuggee;
    17     gPanel = aPanel;
    18     gDebugger = gPanel.panelWin;
    19     gFrames = gDebugger.DebuggerView.StackFrames;
    20     gClassicFrames = gDebugger.DebuggerView.StackFramesClassicList;
    22     waitForSourceAndCaretAndScopes(gPanel, ".html", 14).then(performTest);
    23     gDebuggee.simpleCall();
    24   });
    25 }
    27 function performTest() {
    28   is(gDebugger.gThreadClient.state, "paused",
    29     "Should only be getting stack frames while paused.");
    30   is(gFrames.itemCount, 1,
    31     "Should have only one frame.");
    32   is(gClassicFrames.itemCount, 1,
    33     "Should also have only one frame in the mirrored view.");
    35   resumeDebuggerThenCloseAndFinish(gPanel);
    36 }
    38 registerCleanupFunction(function() {
    39   gTab = null;
    40   gDebuggee = null;
    41   gPanel = null;
    42   gDebugger = null;
    43   gFrames = null;
    44   gClassicFrames = null;
    45 });

mercurial