Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / netmonitor / test / browser_net_header-dns.js
blobc7dc5b016af4cb6e741b49c6b8713c5c9238d383
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 /**
7 * Tests if "DNS Resolution" is displayed in the headers panel and
8 * that requests that are resolve over DNS over HTTPS are accuratelly tracked.
9 * Note: Test has to run as a http3 test for the DoH servers to be used
12 add_task(async function testCheckDNSResolution() {
13 Services.dns.clearCache(true);
14 // Force to use DNS Trusted Recursive Resolver only
15 await pushPref("network.trr.mode", 3);
17 const { monitor } = await initNetMonitor(HTTPS_SIMPLE_URL, {
18 enableCache: true,
19 requestCount: 1,
20 });
22 const { document } = monitor.panelWin;
24 const requestsComplete = waitForNetworkEvents(monitor, 1);
25 await reloadBrowser();
26 await requestsComplete;
28 // Wait until the tab panel summary is displayed
29 const waitForTab = waitUntil(
30 () => document.querySelectorAll(".tabpanel-summary-label")[0]
32 EventUtils.sendMouseEvent(
33 { type: "mousedown" },
34 document.querySelectorAll(".request-list-item")[0]
36 await waitForTab;
38 const dnsEl = [...document.querySelectorAll(".headers-summary")].find(
39 el =>
40 el.querySelector(".headers-summary-label").textContent ===
41 "DNS Resolution"
44 is(
45 dnsEl.querySelector(".tabpanel-summary-value").textContent,
46 L10N.getStr(`netmonitor.headers.dns.overHttps`),
47 "The DNS Resolution value showed correctly"
50 return teardown(monitor);
51 });