1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
7 * Tests if JSON responses with property 'type' are correctly rendered.
8 * (Reps rendering JSON responses should use `noGrip=true`).
10 add_task(async
function () {
11 const { tab
, monitor
} = await
initNetMonitor(
12 JSON_BASIC_URL
+ "?name=nogrip",
15 info("Starting test... ");
17 const { document
, store
, windowRequire
} = monitor
.panelWin
;
18 const Actions
= windowRequire("devtools/client/netmonitor/src/actions/index");
20 store
.dispatch(Actions
.batchEnable(false));
22 await
performRequests(monitor
, tab
, 1);
24 const onResponsePanelReady
= waitForDOM(
26 "#response-panel .data-header"
29 const onPropsViewReady
= waitForDOM(
31 "#response-panel .properties-view",
35 store
.dispatch(Actions
.toggleNetworkDetails());
36 clickOnSidebarTab(document
, "response");
37 await Promise
.all([onResponsePanelReady
, onPropsViewReady
]);
39 const tabpanel
= document
.querySelector("#response-panel");
40 const labels
= tabpanel
.querySelectorAll("tr .treeLabelCell .treeLabel");
41 const values
= tabpanel
.querySelectorAll("tr .treeValueCell .objectBox");
43 is(labels
[0].textContent
, "obj", "The first json property name is correct.");
45 values
[0].textContent
,
46 'Object { type: "string" }',
47 "The first json property value is correct."
50 await
teardown(monitor
);