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: * Tests if the network inspector view is shown when the target navigates michael@0: * away while in the statistics view. michael@0: */ michael@0: michael@0: function test() { michael@0: initNetMonitor(STATISTICS_URL).then(([aTab, aDebuggee, aMonitor]) => { michael@0: info("Starting test... "); michael@0: michael@0: let panel = aMonitor.panelWin; michael@0: let { document, EVENTS, NetMonitorView } = panel; michael@0: michael@0: is(NetMonitorView.currentFrontendMode, "network-inspector-view", michael@0: "The initial frontend mode is correct."); michael@0: michael@0: promise.all([ michael@0: waitFor(panel, EVENTS.PRIMED_CACHE_CHART_DISPLAYED), michael@0: waitFor(panel, EVENTS.EMPTY_CACHE_CHART_DISPLAYED) michael@0: ]).then(() => { michael@0: is(NetMonitorView.currentFrontendMode, "network-statistics-view", michael@0: "The frontend mode is currently in the statistics view."); michael@0: michael@0: waitFor(panel, EVENTS.TARGET_WILL_NAVIGATE).then(() => { michael@0: is(NetMonitorView.currentFrontendMode, "network-inspector-view", michael@0: "The frontend mode switched back to the inspector view."); michael@0: michael@0: waitFor(panel, EVENTS.TARGET_DID_NAVIGATE).then(() => { michael@0: is(NetMonitorView.currentFrontendMode, "network-inspector-view", michael@0: "The frontend mode is still in the inspector view."); michael@0: michael@0: teardown(aMonitor).then(finish); michael@0: }); michael@0: }); michael@0: michael@0: aDebuggee.location.reload(); michael@0: }); michael@0: michael@0: NetMonitorView.toggleFrontendMode(); michael@0: }); michael@0: }