1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
7 * Tests if the statistics panel displays correctly.
10 add_task(async
function () {
11 const { monitor
} = await
initNetMonitor(STATISTICS_URL
, { requestCount
: 1 });
12 info("Starting test... ");
14 const panel
= monitor
.panelWin
;
15 const { document
, store
, windowRequire
, connector
} = panel
;
16 const Actions
= windowRequire("devtools/client/netmonitor/src/actions/index");
19 document
.querySelector(".monitor-panel"),
20 "The current main panel is correct."
23 info("Displaying statistics panel");
24 store
.dispatch(Actions
.openStatistics(connector
, true));
27 document
.querySelector(".statistics-panel"),
28 "The current main panel is correct."
31 info("Waiting for placeholder to display");
35 document
.querySelectorAll(".pie-chart-container[placeholder=true]")
38 ok(true, "Two placeholder pie charts appear to be rendered correctly.");
42 document
.querySelectorAll(".table-chart-container[placeholder=true]")
45 ok(true, "Two placeholde table charts appear to be rendered correctly.");
47 info("Waiting for chart to display");
51 document
.querySelectorAll(".pie-chart-container:not([placeholder=true])")
54 ok(true, "Two real pie charts appear to be rendered correctly.");
58 document
.querySelectorAll(
59 ".table-chart-container:not([placeholder=true])"
62 ok(true, "Two real table charts appear to be rendered correctly.");
64 await
teardown(monitor
);