diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/netmonitor/test/browser_net_statistics-02.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/netmonitor/test/browser_net_statistics-02.js')
-rw-r--r-- | devtools/client/netmonitor/test/browser_net_statistics-02.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/devtools/client/netmonitor/test/browser_net_statistics-02.js b/devtools/client/netmonitor/test/browser_net_statistics-02.js new file mode 100644 index 000000000..361247e16 --- /dev/null +++ b/devtools/client/netmonitor/test/browser_net_statistics-02.js @@ -0,0 +1,42 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Tests if the network inspector view is shown when the target navigates + * away while in the statistics view. + */ + +add_task(function* () { + let { tab, monitor } = yield initNetMonitor(STATISTICS_URL); + info("Starting test... "); + + let panel = monitor.panelWin; + let { EVENTS, NetMonitorView } = panel; + is(NetMonitorView.currentFrontendMode, "network-inspector-view", + "The initial frontend mode is correct."); + + let onChartDisplayed = Promise.all([ + panel.once(EVENTS.PRIMED_CACHE_CHART_DISPLAYED), + panel.once(EVENTS.EMPTY_CACHE_CHART_DISPLAYED) + ]); + + info("Displaying statistics view"); + NetMonitorView.toggleFrontendMode(); + yield onChartDisplayed; + is(NetMonitorView.currentFrontendMode, "network-statistics-view", + "The frontend mode is currently in the statistics view."); + + info("Reloading page"); + let onWillNavigate = panel.once(EVENTS.TARGET_WILL_NAVIGATE); + let onDidNavigate = panel.once(EVENTS.TARGET_DID_NAVIGATE); + tab.linkedBrowser.reload(); + yield onWillNavigate; + is(NetMonitorView.currentFrontendMode, "network-inspector-view", + "The frontend mode switched back to the inspector view."); + yield onDidNavigate; + is(NetMonitorView.currentFrontendMode, "network-inspector-view", + "The frontend mode is still in the inspector view."); + yield teardown(monitor); +}); |