Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / netmonitor / test / browser_net_decode-url.js
blobe3a900f313b2dfc19ba6ec36e3ef6e8beef4d451
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 /**
7 * Tests if "Request URL" containing "#" in its query is correctly decoded.
8 */
9 add_task(async function () {
10 const { tab, monitor } = await initNetMonitor(POST_RAW_URL_WITH_HASH, {
11 requestCount: 1,
12 });
13 info("Starting test... ");
15 const { document, store, windowRequire } = monitor.panelWin;
16 const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
17 store.dispatch(Actions.batchEnable(false));
19 // Execute request.
20 await performRequests(monitor, tab, 1);
22 // Wait until the url preview ihas loaded
23 const wait = waitUntil(() =>
24 document.querySelector("#headers-panel .url-preview")
27 EventUtils.sendMouseEvent(
28 { type: "mousedown" },
29 document.querySelectorAll(".request-list-item")[0]
32 await wait;
34 const requestURL = document.querySelector("#headers-panel .url-preview .url");
35 is(
36 requestURL.textContent.endsWith("foo # bar"),
37 true,
38 "\"Request URL\" containing '#' is correctly decoded."
41 return teardown(monitor);
42 });