browser/devtools/debugger/test/browser_dbg_blackboxing-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 clicking the black box checkbox when paused doesn't re-select the
     6  * currently paused frame's source.
     7  */
     9 const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
    11 let gTab, gDebuggee, gPanel, gDebugger;
    12 let gSources;
    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;
    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       });
    29     gDebuggee.runTest();
    30   });
    31 }
    33 function testBlackBox() {
    34   const selectedUrl = gSources.selectedValue;
    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.");
    41     return toggleBlackBoxing(gPanel).then(() => {
    42       is(gSources.selectedValue, newSelectedUrl,
    43         "The selected source did not change.");
    44     });
    45   });
    47   gSources.selectedIndex = 0;
    48   return finished;
    49 }
    51 registerCleanupFunction(function() {
    52   gTab = null;
    53   gDebuggee = null;
    54   gPanel = null;
    55   gDebugger = null;
    56   gSources = null;
    57 });

mercurial