browser/devtools/debugger/test/browser_dbg_location-changes-02-blank.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  * Make sure that changing the tab location URL to a page with no sources works.
     6  */
     8 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
    10 let gTab, gDebuggee, gPanel, gDebugger;
    11 let gEditor, gSources, gFrames;
    13 function test() {
    14   initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
    15     gTab = aTab;
    16     gDebuggee = aDebuggee;
    17     gPanel = aPanel;
    18     gDebugger = gPanel.panelWin;
    19     gEditor = gDebugger.DebuggerView.editor;
    20     gSources = gDebugger.DebuggerView.Sources;
    21     gFrames = gDebugger.DebuggerView.StackFrames;
    23     waitForSourceAndCaretAndScopes(gPanel, ".html", 14).then(testLocationChange);
    24     gDebuggee.simpleCall();
    25   });
    26 }
    28 function testLocationChange() {
    29   navigateActiveTabTo(gPanel, "about:blank", gDebugger.EVENTS.SOURCES_ADDED).then(() => {
    30     isnot(gDebugger.gThreadClient.state, "paused",
    31       "Should not be paused after a tab navigation.");
    33     is(gFrames.itemCount, 0,
    34       "Should have no frames.");
    36     is(gSources.itemCount, 0,
    37       "Found no entries in the sources widget.");
    39     is(gSources.selectedValue, "",
    40       "There should be no selected source value.");
    41     is(gEditor.getText().length, 0,
    42       "The source editor should not have any text displayed.");
    44     is(gDebugger.document.querySelectorAll("#sources .side-menu-widget-empty-text").length, 1,
    45       "The sources widget should now display a notice (1).");
    46     is(gDebugger.document.querySelectorAll("#sources .side-menu-widget-empty-text")[0].getAttribute("value"),
    47        gDebugger.L10N.getStr("noSourcesText"),
    48       "The sources widget should now display a notice (2).");
    50     closeDebuggerAndFinish(gPanel);
    51   });
    52 }
    54 registerCleanupFunction(function() {
    55   gTab = null;
    56   gDebuggee = null;
    57   gPanel = null;
    58   gDebugger = null;
    59   gEditor = null;
    60   gSources = null;
    61   gFrames = null;
    62 });

mercurial