|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Test that the tracer doesn't connect to the backend when tracing is disabled. |
|
6 */ |
|
7 |
|
8 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html"; |
|
9 const TRACER_PREF = "devtools.debugger.tracer"; |
|
10 |
|
11 let gTab, gDebuggee, gPanel, gDebugger; |
|
12 let gOriginalPref = Services.prefs.getBoolPref(TRACER_PREF); |
|
13 Services.prefs.setBoolPref(TRACER_PREF, false); |
|
14 |
|
15 function test() { |
|
16 initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => { |
|
17 gTab = aTab; |
|
18 gDebuggee = aDebuggee; |
|
19 gPanel = aPanel; |
|
20 gDebugger = gPanel.panelWin; |
|
21 |
|
22 waitForSourceShown(gPanel, "code_tracing-01.js") |
|
23 .then(() => { |
|
24 ok(!gDebugger.DebuggerController.traceClient, "Should not have a trace client"); |
|
25 closeDebuggerAndFinish(gPanel); |
|
26 }) |
|
27 .then(null, aError => { |
|
28 ok(false, "Got an error: " + aError.message + "\n" + aError.stack); |
|
29 }); |
|
30 }); |
|
31 } |
|
32 |
|
33 registerCleanupFunction(function() { |
|
34 gTab = null; |
|
35 gDebuggee = null; |
|
36 gPanel = null; |
|
37 gDebugger = null; |
|
38 Services.prefs.setBoolPref(TRACER_PREF, gOriginalPref); |
|
39 }); |