mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1330967 - Can not open Statistics view after switching between 2 views several times, r=Honza
MozReview-Commit-ID: J78OhW7my88 --HG-- extra : rebase_source : 3c4dada15fe22c2e76047dbc76bfc1807dcbc668
This commit is contained in:
parent
21aea98345
commit
6eb9d9a171
@ -423,10 +423,6 @@ TargetEventsHandler.prototype = {
|
||||
// If the log is persistent, just clear all accumulated timing markers.
|
||||
gStore.dispatch(Actions.clearTimingMarkers());
|
||||
}
|
||||
// Switch to the default network traffic inspector view.
|
||||
if (NetMonitorController.getCurrentActivity() == ACTIVITY_TYPE.NONE) {
|
||||
NetMonitorView.showNetworkInspectorView();
|
||||
}
|
||||
|
||||
window.emit(EVENTS.TARGET_WILL_NAVIGATE);
|
||||
break;
|
||||
|
@ -154,7 +154,6 @@ skip-if = true # Redundant for React/Redux version
|
||||
[browser_net_sort-03.js]
|
||||
[browser_net_statistics-01.js]
|
||||
[browser_net_statistics-02.js]
|
||||
[browser_net_statistics-03.js]
|
||||
[browser_net_status-codes.js]
|
||||
[browser_net_streaming-response.js]
|
||||
[browser_net_throttle.js]
|
||||
|
@ -4,40 +4,43 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Tests if the network inspector view is shown when the target navigates
|
||||
* away while in the statistics view.
|
||||
* Test if the correct filtering predicates are used when filtering from
|
||||
* the performance analysis view.
|
||||
*/
|
||||
|
||||
add_task(function* () {
|
||||
let { tab, monitor } = yield initNetMonitor(STATISTICS_URL);
|
||||
let { monitor } = yield initNetMonitor(FILTERING_URL);
|
||||
info("Starting test... ");
|
||||
|
||||
let panel = monitor.panelWin;
|
||||
let { $, $all, EVENTS, NetMonitorView, gStore, windowRequire } = panel;
|
||||
let Actions = windowRequire("devtools/client/netmonitor/actions/index");
|
||||
is(NetMonitorView.currentFrontendMode, "network-inspector-view",
|
||||
"The initial frontend mode is correct.");
|
||||
|
||||
let onChartDisplayed = Promise.all([
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-html-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-css-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-js-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-ws-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-other-button"));
|
||||
testFilterButtonsCustom(monitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1]);
|
||||
info("The correct filtering predicates are used before entering perf. analysis mode.");
|
||||
|
||||
let onEvents = promise.all([
|
||||
panel.once(EVENTS.PRIMED_CACHE_CHART_DISPLAYED),
|
||||
panel.once(EVENTS.EMPTY_CACHE_CHART_DISPLAYED)
|
||||
]);
|
||||
|
||||
info("Displaying statistics view");
|
||||
gStore.dispatch(Actions.openStatistics(true));
|
||||
yield onChartDisplayed;
|
||||
is(NetMonitorView.currentFrontendMode, "network-statistics-view",
|
||||
"The frontend mode is currently in the statistics view.");
|
||||
yield onEvents;
|
||||
|
||||
is(NetMonitorView.currentFrontendMode, "network-statistics-view",
|
||||
"The frontend mode is switched to the statistics view.");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $(".pie-chart-slice"));
|
||||
|
||||
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.");
|
||||
"The frontend mode is switched back to the inspector view.");
|
||||
|
||||
testFilterButtons(monitor, "html");
|
||||
info("The correct filtering predicate is used when exiting perf. analysis mode.");
|
||||
|
||||
yield teardown(monitor);
|
||||
});
|
||||
|
@ -1,46 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test if the correct filtering predicates are used when filtering from
|
||||
* the performance analysis view.
|
||||
*/
|
||||
|
||||
add_task(function* () {
|
||||
let { monitor } = yield initNetMonitor(FILTERING_URL);
|
||||
info("Starting test... ");
|
||||
|
||||
let panel = monitor.panelWin;
|
||||
let { $, $all, EVENTS, NetMonitorView, gStore, windowRequire } = panel;
|
||||
let Actions = windowRequire("devtools/client/netmonitor/actions/index");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-html-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-css-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-js-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-ws-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $("#requests-menu-filter-other-button"));
|
||||
testFilterButtonsCustom(monitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1]);
|
||||
info("The correct filtering predicates are used before entering perf. analysis mode.");
|
||||
|
||||
let onEvents = promise.all([
|
||||
panel.once(EVENTS.PRIMED_CACHE_CHART_DISPLAYED),
|
||||
panel.once(EVENTS.EMPTY_CACHE_CHART_DISPLAYED)
|
||||
]);
|
||||
gStore.dispatch(Actions.openStatistics(true));
|
||||
yield onEvents;
|
||||
|
||||
is(NetMonitorView.currentFrontendMode, "network-statistics-view",
|
||||
"The frontend mode is switched to the statistics view.");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" }, $(".pie-chart-slice"));
|
||||
|
||||
is(NetMonitorView.currentFrontendMode, "network-inspector-view",
|
||||
"The frontend mode is switched back to the inspector view.");
|
||||
|
||||
testFilterButtons(monitor, "html");
|
||||
info("The correct filtering predicate is used when exiting perf. analysis mode.");
|
||||
|
||||
yield teardown(monitor);
|
||||
});
|
Loading…
Reference in New Issue
Block a user