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