browser/devtools/debugger/test/browser_dbg_blackboxing-06.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:64f1049225fc
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Test that clicking the black box checkbox when paused doesn't re-select the
6 * currently paused frame's source.
7 */
8
9 const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
10
11 let gTab, gDebuggee, gPanel, gDebugger;
12 let gSources;
13
14 function test() {
15 initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
16 gTab = aTab;
17 gDebuggee = aDebuggee;
18 gPanel = aPanel;
19 gDebugger = gPanel.panelWin;
20 gSources = gDebugger.DebuggerView.Sources;
21
22 waitForSourceAndCaretAndScopes(gPanel, ".html", 21)
23 .then(testBlackBox)
24 .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
25 .then(null, aError => {
26 ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
27 });
28
29 gDebuggee.runTest();
30 });
31 }
32
33 function testBlackBox() {
34 const selectedUrl = gSources.selectedValue;
35
36 let finished = waitForSourceShown(gPanel, "blackboxme.js").then(() => {
37 const newSelectedUrl = gSources.selectedValue;
38 isnot(selectedUrl, newSelectedUrl,
39 "Should not have the same url selected.");
40
41 return toggleBlackBoxing(gPanel).then(() => {
42 is(gSources.selectedValue, newSelectedUrl,
43 "The selected source did not change.");
44 });
45 });
46
47 gSources.selectedIndex = 0;
48 return finished;
49 }
50
51 registerCleanupFunction(function() {
52 gTab = null;
53 gDebuggee = null;
54 gPanel = null;
55 gDebugger = null;
56 gSources = null;
57 });

mercurial