blob: 900e3bfc345f6b03b0fa1e6da7ca7560e0556121 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI =
"data:text/html;charset=utf8,<!DOCTYPE html>Test that 'Resend Request' context menu " +
"item resends the selected request and select it in netmonitor panel.";
const TEST_FILE = "test-network-request.html";
const TEST_PATH =
"https://example.com/browser/devtools/client/webconsole/test/browser/";
registerCleanupFunction(async function () {
await new Promise(resolve => {
Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value =>
resolve()
);
});
});
add_task(async function task() {
await pushPref("devtools.webconsole.filter.net", true);
const hud = await openNewTabAndConsole(TEST_URI);
const documentUrl = TEST_PATH + TEST_FILE;
await navigateTo(documentUrl);
info("Document loaded.");
const message = await waitFor(() =>
findMessageByType(hud, documentUrl, ".network")
);
const menuPopup = await openContextMenu(hud, message);
const openResendRequestMenuItem = menuPopup.querySelector(
"#console-menu-resend-network-request"
);
ok(openResendRequestMenuItem, "resend network request item is enabled");
// Wait for message containing the resent request url
menuPopup.activateItem(openResendRequestMenuItem);
await waitFor(
() => findMessagesByType(hud, documentUrl, ".network").length === 2
);
ok(true, "The resent request url is correct.");
});
|