Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / netmonitor / test / browser_net_domain-not-found.js
blobd4e3e9eaab40af3bd524da24c90ebe79b84449c8
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 /**
7 * Tests that the request for a domain that is not found shows
8 * correctly.
9 */
10 add_task(async function () {
11 const URL = "https://not-existed.com/";
12 const { monitor } = await initNetMonitor(URL, {
13 requestCount: 1,
14 waitForLoad: false,
15 });
16 info("Starting test... ");
18 const { document, store, windowRequire } = monitor.panelWin;
19 const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
21 store.dispatch(Actions.batchEnable(false));
23 const wait = waitForNetworkEvents(monitor, 1);
24 reloadBrowser({ waitForLoad: false });
25 await wait;
27 const firstItem = document.querySelectorAll(".request-list-item")[0];
29 is(
30 firstItem.querySelector(".requests-list-url").innerText,
31 URL,
32 "The url in the displayed request is correct"
34 is(
35 firstItem.querySelector(".requests-list-transferred").innerText,
36 "NS_ERROR_UNKNOWN_HOST",
37 "The error in the displayed request is correct"
40 await teardown(monitor);
41 });