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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:8d1369b40fb0
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Test that closing a tab with the debugger in a paused state exits cleanly.
6 */
7
8 let gTab, gDebuggee, gPanel, gDebugger;
9
10 const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
11
12 function test() {
13 initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
14 gTab = aTab;
15 gDebuggee = aDebuggee;
16 gPanel = aPanel;
17 gDebugger = gPanel.panelWin;
18
19 testCleanExit();
20 });
21 }
22
23 function testCleanExit() {
24 waitForSourceAndCaretAndScopes(gPanel, ".html", 16).then(() => {
25 is(gDebugger.gThreadClient.paused, true,
26 "Should be paused after the debugger statement.");
27
28 closeDebuggerAndFinish(gPanel, { whilePaused: true });
29 });
30
31 gDebuggee.runDebuggerStatement();
32 }
33
34 registerCleanupFunction(function() {
35 gTab = null;
36 gDebuggee = null;
37 gPanel = null;
38 gDebugger = null;
39 });

mercurial