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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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