michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Make sure that changing the tab location URL works. michael@0: */ michael@0: michael@0: const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html"; michael@0: michael@0: let gTab, gDebuggee, gPanel, gDebugger; michael@0: let gEditor, gSources, gFrames; michael@0: michael@0: function test() { michael@0: initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => { michael@0: gTab = aTab; michael@0: gDebuggee = aDebuggee; michael@0: gPanel = aPanel; michael@0: gDebugger = gPanel.panelWin; michael@0: gEditor = gDebugger.DebuggerView.editor; michael@0: gSources = gDebugger.DebuggerView.Sources; michael@0: gFrames = gDebugger.DebuggerView.StackFrames; michael@0: michael@0: waitForSourceAndCaretAndScopes(gPanel, ".html", 14).then(performTest); michael@0: gDebuggee.simpleCall(); michael@0: }); michael@0: } michael@0: michael@0: function performTest() { michael@0: is(gDebugger.gThreadClient.state, "paused", michael@0: "Should only be getting stack frames while paused."); michael@0: michael@0: is(gFrames.itemCount, 1, michael@0: "Should have only one frame."); michael@0: michael@0: is(gSources.itemCount, 1, michael@0: "Found the expected number of entries in the sources widget."); michael@0: michael@0: isnot(gSources.selectedValue, null, michael@0: "There should be a selected source value."); michael@0: isnot(gEditor.getText().length, 0, michael@0: "The source editor should have some text displayed."); michael@0: isnot(gEditor.getText(), gDebugger.L10N.getStr("loadingText"), michael@0: "The source editor text should not be 'Loading...'"); michael@0: michael@0: is(gDebugger.document.querySelectorAll("#sources .side-menu-widget-empty-notice-container").length, 0, michael@0: "The sources widget should not display any notice at this point (1)."); michael@0: is(gDebugger.document.querySelectorAll("#sources .side-menu-widget-empty-notice").length, 0, michael@0: "The sources widget should not display any notice at this point (2)."); michael@0: is(gDebugger.document.querySelector("#sources .side-menu-widget-empty-notice > label"), null, michael@0: "The sources widget should not display a notice at this point (3)."); michael@0: michael@0: gDebugger.gThreadClient.resume(() => { michael@0: testLocationChange(); michael@0: }); michael@0: } michael@0: michael@0: function testLocationChange() { michael@0: navigateActiveTabTo(gPanel, "about:blank", gDebugger.EVENTS.SOURCES_ADDED).then(() => { michael@0: closeDebuggerAndFinish(gPanel); michael@0: }); michael@0: } michael@0: michael@0: registerCleanupFunction(function() { michael@0: gTab = null; michael@0: gDebuggee = null; michael@0: gPanel = null; michael@0: gDebugger = null; michael@0: gEditor = null; michael@0: gSources = null; michael@0: gFrames = null; michael@0: });