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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Test that the tracer doesn't connect to the backend when tracing is disabled.
     6  */
     8 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
     9 const TRACER_PREF = "devtools.debugger.tracer";
    11 let gTab, gDebuggee, gPanel, gDebugger;
    12 let gOriginalPref = Services.prefs.getBoolPref(TRACER_PREF);
    13 Services.prefs.setBoolPref(TRACER_PREF, false);
    15 function test() {
    16   initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
    17     gTab = aTab;
    18     gDebuggee = aDebuggee;
    19     gPanel = aPanel;
    20     gDebugger = gPanel.panelWin;
    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 }
    33 registerCleanupFunction(function() {
    34   gTab = null;
    35   gDebuggee = null;
    36   gPanel = null;
    37   gDebugger = null;
    38   Services.prefs.setBoolPref(TRACER_PREF, gOriginalPref);
    39 });

mercurial