browser/devtools/debugger/test/browser_dbg_clean-exit.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 closing a tab with the debugger in a paused state exits cleanly.
     6  */
     8 let gTab, gDebuggee, gPanel, gDebugger;
    10 const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
    12 function test() {
    13   initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
    14     gTab = aTab;
    15     gDebuggee = aDebuggee;
    16     gPanel = aPanel;
    17     gDebugger = gPanel.panelWin;
    19     testCleanExit();
    20   });
    21 }
    23 function testCleanExit() {
    24   waitForSourceAndCaretAndScopes(gPanel, ".html", 16).then(() => {
    25     is(gDebugger.gThreadClient.paused, true,
    26       "Should be paused after the debugger statement.");
    28     closeDebuggerAndFinish(gPanel, { whilePaused: true });
    29   });
    31   gDebuggee.runDebuggerStatement();
    32 }
    34 registerCleanupFunction(function() {
    35   gTab = null;
    36   gDebuggee = null;
    37   gPanel = null;
    38   gDebugger = null;
    39 });

mercurial