browser/devtools/debugger/test/browser_dbg_clean-exit.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/debugger/test/browser_dbg_clean-exit.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/**
     1.8 + * Test that closing a tab with the debugger in a paused state exits cleanly.
     1.9 + */
    1.10 +
    1.11 +let gTab, gDebuggee, gPanel, gDebugger;
    1.12 +
    1.13 +const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
    1.14 +
    1.15 +function test() {
    1.16 +  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
    1.17 +    gTab = aTab;
    1.18 +    gDebuggee = aDebuggee;
    1.19 +    gPanel = aPanel;
    1.20 +    gDebugger = gPanel.panelWin;
    1.21 +
    1.22 +    testCleanExit();
    1.23 +  });
    1.24 +}
    1.25 +
    1.26 +function testCleanExit() {
    1.27 +  waitForSourceAndCaretAndScopes(gPanel, ".html", 16).then(() => {
    1.28 +    is(gDebugger.gThreadClient.paused, true,
    1.29 +      "Should be paused after the debugger statement.");
    1.30 +
    1.31 +    closeDebuggerAndFinish(gPanel, { whilePaused: true });
    1.32 +  });
    1.33 +
    1.34 +  gDebuggee.runDebuggerStatement();
    1.35 +}
    1.36 +
    1.37 +registerCleanupFunction(function() {
    1.38 +  gTab = null;
    1.39 +  gDebuggee = null;
    1.40 +  gPanel = null;
    1.41 +  gDebugger = null;
    1.42 +});

mercurial