summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/test/browser_net_statistics-01.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-01.js
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.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 '')
-rw-r--r--devtools/client/netmonitor/test/browser_net_statistics-01.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/devtools/client/netmonitor/test/browser_net_statistics-01.js b/devtools/client/netmonitor/test/browser_net_statistics-01.js
new file mode 100644
index 0000000000..5a0c5f661e
--- /dev/null
+++ b/devtools/client/netmonitor/test/browser_net_statistics-01.js
@@ -0,0 +1,65 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Tests if the statistics panel displays correctly.
+ */
+
+add_task(async function () {
+ const { monitor } = await initNetMonitor(STATISTICS_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");
+
+ ok(
+ document.querySelector(".monitor-panel"),
+ "The current main panel is correct."
+ );
+
+ info("Displaying statistics panel");
+ store.dispatch(Actions.openStatistics(connector, true));
+
+ ok(
+ document.querySelector(".statistics-panel"),
+ "The current main panel is correct."
+ );
+
+ info("Waiting for placeholder to display");
+
+ await waitUntil(
+ () =>
+ document.querySelectorAll(".pie-chart-container[placeholder=true]")
+ .length == 2
+ );
+ ok(true, "Two placeholder pie charts appear to be rendered correctly.");
+
+ await waitUntil(
+ () =>
+ document.querySelectorAll(".table-chart-container[placeholder=true]")
+ .length == 2
+ );
+ ok(true, "Two placeholde table charts appear to be rendered correctly.");
+
+ info("Waiting for chart to display");
+
+ await waitUntil(
+ () =>
+ document.querySelectorAll(".pie-chart-container:not([placeholder=true])")
+ .length == 2
+ );
+ ok(true, "Two real pie charts appear to be rendered correctly.");
+
+ await waitUntil(
+ () =>
+ document.querySelectorAll(
+ ".table-chart-container:not([placeholder=true])"
+ ).length == 2
+ );
+ ok(true, "Two real table charts appear to be rendered correctly.");
+
+ await teardown(monitor);
+});