summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/test/browser_net_statistics-02.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/netmonitor/test/browser_net_statistics-02.js
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/netmonitor/test/browser_net_statistics-02.js')
-rw-r--r--devtools/client/netmonitor/test/browser_net_statistics-02.js74
1 files changed, 74 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 0000000000..ccc25a387d
--- /dev/null
+++ b/devtools/client/netmonitor/test/browser_net_statistics-02.js
@@ -0,0 +1,74 @@
+/* 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(async function () {
+ const { monitor } = await initNetMonitor(FILTERING_URL, { requestCount: 1 });
+ info("Starting test... ");
+
+ const panel = monitor.panelWin;
+ const { document, store, windowRequire, connector } = panel;
+ const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
+
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".requests-list-filter-html-button")
+ );
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".requests-list-filter-css-button")
+ );
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".requests-list-filter-js-button")
+ );
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".requests-list-filter-ws-button")
+ );
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".requests-list-filter-other-button")
+ );
+ testFilterButtonsCustom(monitor, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1]);
+ info(
+ "The correct filtering predicates are used before entering perf. analysis mode."
+ );
+
+ store.dispatch(Actions.openStatistics(connector, true));
+
+ ok(
+ document.querySelector(".statistics-panel"),
+ "The main panel is switched to the statistics panel."
+ );
+
+ await waitUntil(
+ () =>
+ document.querySelectorAll(".pie-chart-container:not([placeholder=true])")
+ .length == 2
+ );
+ ok(true, "Two real pie charts appear to be rendered correctly.");
+
+ EventUtils.sendMouseEvent(
+ { type: "click" },
+ document.querySelector(".pie-chart-slice-container")
+ );
+
+ ok(
+ document.querySelector(".monitor-panel"),
+ "The main panel is switched back to the monitor panel."
+ );
+
+ testFilterButtons(monitor, "html");
+ info(
+ "The correct filtering predicate is used when exiting perf. analysis mode."
+ );
+
+ await teardown(monitor);
+});