1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
7 * Tests if server side timings are displayed
9 add_task(async
function () {
10 const { tab
, monitor
} = await
initNetMonitor(HTTPS_CUSTOM_GET_URL
, {
14 const { document
, store
, windowRequire
} = monitor
.panelWin
;
15 const Actions
= windowRequire("devtools/client/netmonitor/src/actions/index");
16 store
.dispatch(Actions
.batchEnable(false));
18 let wait
= waitForNetworkEvents(monitor
, 1);
19 await SpecialPowers
.spawn(
21 [SERVER_TIMINGS_TYPE_SJS
],
22 async
function (url
) {
23 content
.wrappedJSObject
.performRequests(1, url
);
28 // There must be 4 timing values (including server side timings).
29 const timingsSelector
= "#timings-panel .tabpanel-summary-container.server";
30 wait
= waitForDOM(document
, timingsSelector
, 4);
32 AccessibilityUtils
.setEnv({
33 // Keyboard users will will see the sidebar when the request row is
34 // selected. Accessibility is handled on the container level.
35 actionCountRule
: false,
36 interactiveRule
: false,
39 EventUtils
.sendMouseEvent(
41 document
.querySelectorAll(".request-list-item")[0]
43 AccessibilityUtils
.resetEnv();
45 store
.dispatch(Actions
.toggleNetworkDetails());
47 clickOnSidebarTab(document
, "timings");
50 // Check the UI contains server side timings and correct values
51 const timings
= document
.querySelectorAll(timingsSelector
, 4);
53 timings
[0].textContent
,
55 "The first server-timing must be correct"
58 timings
[1].textContent
,
60 "The second server-timing must be correct"
63 timings
[2].textContent
,
65 "The third server-timing must be correct"
68 timings
[3].textContent
,
70 "The fourth server-timing must be correct"
73 await
teardown(monitor
);