Bug 1689445 - revert EventUtils.sendMouseEvent back to being sync. r=jmaher

Differential Revision: https://phabricator.services.mozilla.com/D104127
This commit is contained in:
Yura Zenevich 2021-02-09 01:30:08 +00:00
parent b486b55b5e
commit c72349ac1a
175 changed files with 543 additions and 625 deletions

View File

@ -280,7 +280,7 @@ async function runTests() {
nsIAccessibleEvent.EVENT_MENUPOPUP_START,
isEventForMenuPopup
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
gURLBar.querySelector("moz-input-box")
);

View File

@ -57,10 +57,7 @@ add_task(async function restore_history_entry_by_middle_click() {
"SSTabRestored"
);
await EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
historyMenuItem
);
EventUtils.sendMouseEvent({ type: "click", button: 1 }, historyMenuItem);
info("Waiting for history menu to be hidden");
await popupHiddenPromise;

View File

@ -22,7 +22,7 @@ add_task(async function mainTest() {
// Open the panel and click the item to show the subview.
let viewPromise = promiseViewShown(DownloadsBlockedSubview.subview);
await EventUtils.sendMouseEvent({ type: "click" }, item);
EventUtils.sendMouseEvent({ type: "click" }, item);
await viewPromise;
// Items are listed in newest-to-oldest order, so e.g. the first item's
@ -39,7 +39,7 @@ add_task(async function mainTest() {
// Show the subview again.
viewPromise = promiseViewShown(DownloadsBlockedSubview.subview);
await EventUtils.sendMouseEvent({ type: "click" }, item);
EventUtils.sendMouseEvent({ type: "click" }, item);
await viewPromise;
// Click the Open button. The download should be unblocked and then opened,
@ -64,7 +64,7 @@ add_task(async function mainTest() {
await openPanel();
viewPromise = promiseViewShown(DownloadsBlockedSubview.subview);
await EventUtils.sendMouseEvent({ type: "click" }, item);
EventUtils.sendMouseEvent({ type: "click" }, item);
await viewPromise;
// Click the Remove button. The panel should close and the item should be

View File

@ -33,10 +33,7 @@ add_task(async function test_overflow_anchor() {
await gCustomizeMode.addToPanel(button.node);
let promise = promisePanelOpened();
await EventUtils.sendMouseEvent(
{ type: "mousedown", button: 0 },
button.node
);
EventUtils.sendMouseEvent({ type: "mousedown", button: 0 }, button.node);
info("waiting for panel to open");
await promise;
@ -55,10 +52,7 @@ add_task(async function test_overflow_anchor() {
// Now try opening the panel again.
promise = promisePanelOpened();
await EventUtils.sendMouseEvent(
{ type: "mousedown", button: 0 },
button.node
);
EventUtils.sendMouseEvent({ type: "mousedown", button: 0 }, button.node);
await promise;
let downloadsAnchor = button.node.badgeStack;

View File

@ -923,7 +923,7 @@ add_task(async function checkTelemetryClickEventsVPN() {
() => ContentTaskUtils.is_visible(getVPNLink),
"get vpn link is visible"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
getVPNLink,
content
@ -960,7 +960,7 @@ add_task(async function checkTelemetryClickEventsVPN() {
.classList.contains("subscribed");
}, "subscribed class is added to the vpn card");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
androidVPNLink,
content
@ -990,7 +990,7 @@ add_task(async function checkTelemetryClickEventsVPN() {
.classList.contains("subscribed");
}, "subscribed class is added to the vpn card");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
iosVPNLink,
content
@ -1064,7 +1064,7 @@ add_task(async function checkTelemetryEventsVPNBanner() {
() => ContentTaskUtils.is_visible(bannerVPNLink),
"vpn banner link is visible"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
bannerVPNLink,
content
@ -1094,7 +1094,7 @@ add_task(async function checkTelemetryEventsVPNBanner() {
() => ContentTaskUtils.is_visible(bannerExitLink),
"vpn banner exit link is visible"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", button: 1 },
bannerExitLink,
content

View File

@ -31,7 +31,7 @@ add_task(async function() {
// We're going to click on the first link, so listen for another load event
info("Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[0],
browser_b.contentWindow
@ -40,7 +40,7 @@ add_task(async function() {
info("Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[1],
browser_b.contentWindow
@ -93,7 +93,7 @@ add_task(async function() {
// We're going to click on the first link, so listen for another load event
info("iframe: Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[0],
browser_b.contentWindow
@ -102,7 +102,7 @@ add_task(async function() {
info("iframe: Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[1],
browser_b.contentWindow
@ -175,7 +175,7 @@ add_task(async function() {
// We're going to click on the first link, so listen for another load event
info("dynamic: Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[0],
browser_b.contentWindow
@ -184,7 +184,7 @@ add_task(async function() {
info("dynamic: Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
links[1],
browser_b.contentWindow

View File

@ -130,7 +130,7 @@ const testsTopLevel = [
setup: async ({ doc }) => {
await toggleRow(doc, 0);
await toggleRow(doc, 1);
await selectRow(doc, 3);
selectRow(doc, 3);
},
expected: {
tree: [documentRow, ...subtree],
@ -154,9 +154,7 @@ const testsTopLevel = [
},
{
desc: "Select third row in the tree.",
setup: async ({ doc }) => {
await selectRow(doc, 1);
},
setup: ({ doc }) => selectRow(doc, 1),
expected: {
sidebar: newHeaderSidebar,
},
@ -171,7 +169,7 @@ const testsOOP = [
await toggleRow(doc, 1);
await toggleRow(doc, 2);
await toggleRow(doc, 3);
await selectRow(doc, 5);
selectRow(doc, 5);
},
expected: {
tree: [documentRowOOP, ...subtreeOOP],
@ -195,9 +193,7 @@ const testsOOP = [
},
{
desc: "Select third row in the tree.",
setup: async ({ doc }) => {
await selectRow(doc, 1);
},
setup: ({ doc }) => selectRow(doc, 1),
expected: {
sidebar: newHeaderSidebar,
},

View File

@ -48,7 +48,7 @@ const tests = [
},
{
desc: "Expand first tree node.",
setup: async ({ doc }) => toggleRow(doc, 0),
setup: ({ doc }) => toggleRow(doc, 0),
expected: {
tree: [
{
@ -68,9 +68,7 @@ const tests = [
},
{
desc: "Select second tree node.",
setup: async ({ doc }) => {
await selectRow(doc, 1);
},
setup: ({ doc }) => selectRow(doc, 1),
expected: {
sidebar: {
name: "Top level header",
@ -100,7 +98,7 @@ const tests = [
// keys.
mustHaveAccessibleRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
relations.querySelector(".arrow"),
win
@ -115,7 +113,7 @@ const tests = [
// activated.
nonNegativeTabIndexRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
containingDocRelation.querySelector(".open-accessibility-inspector"),
win

View File

@ -25,7 +25,7 @@ addA11YPanelTask(
async ({ toolbox, doc }) => {
info("Select an item having an actual associated DOM node");
await toggleRow(doc, 0);
await selectRow(doc, 1);
selectRow(doc, 1);
await BrowserTestUtils.waitForCondition(
() => getPropertyValue(doc, "name") === `"Hello"`,

View File

@ -74,7 +74,7 @@ const tests = [
{
desc: "Select a row that is guaranteed to have to be scrolled into view.",
setup: async ({ doc }) => {
await selectRow(doc, 0);
selectRow(doc, 0);
EventUtils.synthesizeKey("VK_END", {}, doc.defaultView);
},
expected: {

View File

@ -103,9 +103,7 @@ const tests = [
},
{
desc: "Select third tree node.",
setup: async ({ doc }) => {
await selectRow(doc, 2);
},
setup: ({ doc }) => selectRow(doc, 2),
expected: {
sidebar: {
name: "Top level header",

View File

@ -117,7 +117,7 @@ async function addTestTab(url) {
const enableButton = doc.getElementById("accessibility-enable-button");
// If enable button is not found, asume the tool is already enabled.
if (enableButton) {
await EventUtils.sendMouseEvent({ type: "click" }, enableButton, win);
EventUtils.sendMouseEvent({ type: "click" }, enableButton, win);
}
await waitUntilState(
@ -517,7 +517,7 @@ async function selectProperty(doc, id) {
let node;
await focusAccessibleProperties(doc);
await BrowserTestUtils.waitForCondition(async () => {
await BrowserTestUtils.waitForCondition(() => {
node = doc.getElementById(`${id}`);
if (node) {
if (selected) {
@ -529,7 +529,7 @@ async function selectProperty(doc, id) {
// keys.
nonNegativeTabIndexRule: false,
});
await EventUtils.sendMouseEvent({ type: "click" }, node, win);
EventUtils.sendMouseEvent({ type: "click" }, node, win);
AccessibilityUtils.resetEnv();
selected = true;
} else {
@ -548,13 +548,13 @@ async function selectProperty(doc, id) {
* @param {document} doc panel documnent.
* @param {Number} rowNumber number of the row/tree node to be selected.
*/
async function selectRow(doc, rowNumber) {
function selectRow(doc, rowNumber) {
info(`Selecting row ${rowNumber}.`);
AccessibilityUtils.setEnv({
// Keyboard navigation is handled on the container level using arrow keys.
nonNegativeTabIndexRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
doc.querySelectorAll(".treeRow")[rowNumber],
doc.defaultView
@ -580,7 +580,7 @@ async function toggleRow(doc, rowNumber) {
// TreeView component and handle keyboard navigation using the arrow keys.
mustHaveAccessibleRule: false,
});
await EventUtils.sendMouseEvent({ type: "click" }, twisty, win);
EventUtils.sendMouseEvent({ type: "click" }, twisty, win);
AccessibilityUtils.resetEnv();
await BrowserTestUtils.waitForCondition(
() =>

View File

@ -34,7 +34,7 @@ add_task(async function() {
info("Switching files via frame click");
const frames = findAllElements(dbg, "frames");
await pressMouseDown(dbg, frames[1])
pressMouseDown(dbg, frames[1])
// Ensure that the debug line is in view, and not the first "bar" instance,
// which the user would have to scroll down for
@ -47,7 +47,7 @@ add_task(async function() {
el.value = "";
type(dbg, "func");
await waitForSearchState(dbg);
await pressMouseDown(dbg, frames[0]);
pressMouseDown(dbg, frames[0]);
await waitFor(() => cm.state.search.query === "func");
// Ensure there is a match for the new term
@ -66,6 +66,6 @@ function getFocusedEl(dbg) {
return doc.activeElement;
}
async function pressMouseDown(dbg, node) {
await EventUtils.sendMouseEvent({ type: "mousedown" }, node, dbg.win);
function pressMouseDown(dbg, node) {
EventUtils.sendMouseEvent({ type: "mousedown" }, node, dbg.win);
}

View File

@ -75,7 +75,7 @@ async function toggleTool({ doc, panelWin, checkbox, tab }, toolId) {
const onToggleTool = gDevTools.once(
`tool-${prevChecked ? "unregistered" : "registered"}`
);
await EventUtils.sendMouseEvent({ type: "click" }, checkbox, panelWin);
EventUtils.sendMouseEvent({ type: "click" }, checkbox, panelWin);
const id = await onToggleTool;
is(id, toolId, `Correct event for ${toolId} was fired`);

View File

@ -136,7 +136,7 @@ async function getButtonAndMenuInfo(toolbox, menuButton) {
// Users can use arrow keys to navigate between and select tabs.
nonNegativeTabIndexRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{
type: "click",
screenX: 1,

View File

@ -57,11 +57,7 @@ add_task(async function() {
);
const onSelection = inspector.selection.once("new-node-front");
await EventUtils.sendMouseEvent(
{ type: "click" },
elementRep,
doc.defaultView
);
EventUtils.sendMouseEvent({ type: "click" }, elementRep, doc.defaultView);
await onSelection;
is(

View File

@ -87,5 +87,5 @@ async function clickShowMoreNodes(inspector) {
const container = await getContainerForSelector("body", inspector);
const button = container.elt.querySelector("button");
const win = button.ownerDocument.defaultView;
await EventUtils.sendMouseEvent({ type: "click" }, button, win);
EventUtils.sendMouseEvent({ type: "click" }, button, win);
}

View File

@ -33,7 +33,7 @@ async function showAllNodes(inspector) {
ok(button, "All nodes button is here");
const win = button.ownerDocument.defaultView;
await EventUtils.sendMouseEvent({ type: "click" }, button, win);
EventUtils.sendMouseEvent({ type: "click" }, button, win);
await inspector.markup._waitForChildren();
}

View File

@ -94,7 +94,7 @@ add_task(async function() {
checkTelemetry("devtools.markup.scrollable.badge.clicked", "", 2, "scalar");
info("Double-click on the scrollable badge");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "dblclick" },
container.editor._scrollableBadge
);

View File

@ -100,7 +100,7 @@ add_task(async function() {
!!moreNodesLink,
"A 'more nodes' button is displayed in the host container"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
moreNodesLink.querySelector("button")
);

View File

@ -30,7 +30,7 @@ add_task(async function() {
info("Toggling ON the CSS shapes highlighter with transform mode on.");
let onHighlighterShown = highlighters.once("shapes-highlighter-shown");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", metaKey: true, ctrlKey: true },
shapesToggle,
view.styleWindow
@ -49,11 +49,7 @@ add_task(async function() {
info("Toggling OFF the CSS shapes highlighter from the rule-view.");
const onHighlighterHidden = highlighters.once("shapes-highlighter-hidden");
await EventUtils.sendMouseEvent(
{ type: "click" },
shapesToggle,
view.styleWindow
);
EventUtils.sendMouseEvent({ type: "click" }, shapesToggle, view.styleWindow);
await onHighlighterHidden;
info("Checking the CSS shapes highlighter is not shown.");
@ -64,11 +60,7 @@ add_task(async function() {
info("Toggling ON the CSS shapes highlighter with transform mode off.");
onHighlighterShown = highlighters.once("shapes-highlighter-shown");
await EventUtils.sendMouseEvent(
{ type: "click" },
shapesToggle,
view.styleWindow
);
EventUtils.sendMouseEvent({ type: "click" }, shapesToggle, view.styleWindow);
await onHighlighterShown;
info(
@ -88,7 +80,7 @@ add_task(async function() {
"Clicking shapes toggle to turn on transform mode while highlighter is shown."
);
onHighlighterShown = highlighters.once("shapes-highlighter-shown");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", metaKey: true, ctrlKey: true },
shapesToggle,
view.styleWindow

View File

@ -1144,7 +1144,7 @@ async function toggleShapesHighlighter(
if (show) {
const onHighlighterShown = highlighters.once("shapes-highlighter-shown");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", metaKey, ctrlKey },
shapesToggle,
view.styleWindow
@ -1152,7 +1152,7 @@ async function toggleShapesHighlighter(
await onHighlighterShown;
} else {
const onHighlighterHidden = highlighters.once("shapes-highlighter-hidden");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click", metaKey, ctrlKey },
shapesToggle,
view.styleWindow

View File

@ -43,10 +43,10 @@ add_task(async function() {
);
// Select the first request
await EventUtils.sendMouseEvent({ type: "mousedown" }, requests[0]);
EventUtils.sendMouseEvent({ type: "mousedown" }, requests[0]);
// Click on the "Response" panel
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
// Get all messages present in the "Response" panel
@ -78,7 +78,7 @@ add_task(async function() {
is(filteredFrames.length, 2, "There should be two frames");
// Select the second request and check that the filter input is cleared
await EventUtils.sendMouseEvent({ type: "mousedown" }, requests[1]);
EventUtils.sendMouseEvent({ type: "mousedown" }, requests[1]);
// Wait till the text filter is applied. There should be two frames rendered
await waitUntil(
() =>

View File

@ -127,7 +127,7 @@ add_task(async function() {
EventUtils.sendKey("DOWN", window);
check(19, true);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelector(".request-list-item")
);

View File

@ -59,7 +59,7 @@ add_task(async function() {
// Accessibility is handled on the container level.
mustHaveAccessibleRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".search-panel-content .treeRow .treeIcon")
);

View File

@ -91,7 +91,7 @@ async function waitForBlockingAction(store, action) {
async function openMenuAndClick(monitor, store, document, itemSelector) {
info(`Right clicking on white-space in the header to get the context menu`);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector(".request-blocking-contents")
);

View File

@ -72,7 +72,7 @@ add_task(async function() {
const waitForHeaders = waitUntil(() =>
document.querySelector(".headers-overview")
);
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
await waitForHeaders;
normalRequestState = getSelectedRequest(store.getState());
normalRequestSize = firstRequest.querySelector(".requests-list-transferred")
@ -140,7 +140,7 @@ add_task(async function() {
blockedRequestSize = firstRequest.querySelector(
".requests-list-transferred"
).textContent;
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
blockedRequestState = getSelectedRequest(store.getState());
info("Captured blocked request");
}

View File

@ -93,7 +93,7 @@ add_task(async function() {
"The fourth request was not blocked"
);
await EventUtils.sendMouseEvent({ type: "mousedown" }, requestItems[0]);
EventUtils.sendMouseEvent({ type: "mousedown" }, requestItems[0]);
// Right-click test1, select "Unblock URL" from its context menu
await toggleBlockedUrl(requestItems[0], monitor, store, "unblock");

View File

@ -39,7 +39,7 @@ add_task(async function() {
);
const firstRequest = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
await waitForHeaderSections;
@ -57,7 +57,7 @@ add_task(async function() {
info("Captured normal request");
// Mark as blocked
await EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
const contextBlock = getContextMenuItem(
monitor,
"request-list-context-block-url"
@ -94,7 +94,7 @@ add_task(async function() {
);
const firstRequest = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
await waitForHeaderSections;
@ -113,7 +113,7 @@ add_task(async function() {
info("Captured blocked request");
// Mark as unblocked
await EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
const contextUnblock = getContextMenuItem(
monitor,
"request-list-context-unblock-url"
@ -143,7 +143,7 @@ add_task(async function() {
unblockedRequestSize = firstRequest.querySelector(
".requests-list-transferred"
).textContent;
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
unblockedRequestState = getSelectedRequest(store.getState());
info("Captured unblocked request");
}

View File

@ -32,7 +32,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
// Status code title is generated on hover
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -58,7 +58,7 @@ add_task(async function() {
TEST_EVENTS.RECEIVED_RESPONSE_CONTENT
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
await onResponseContent;
await testResponse("br");

View File

@ -101,7 +101,7 @@ add_task(async function() {
const requestItem = document.querySelectorAll(".request-list-item")[index];
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");

View File

@ -32,12 +32,12 @@ add_task(async function() {
info("Clicking item and waiting for details panel to open");
waitPromise = waitForDOM(document, ".network-details-bar");
const xhrRequestItem = document.querySelectorAll(".request-list-item")[3];
await EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequestItem);
EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequestItem);
await waitPromise;
info("Clicking stack tab and waiting for stack panel to open");
waitPromise = waitForDOM(document, "#stack-trace-panel");
await clickOnSidebarTab(document, "stack-trace");
clickOnSidebarTab(document, "stack-trace");
await waitPromise;
info("Waiting for source maps to be applied");

View File

@ -30,7 +30,7 @@ add_task(async function() {
assertSingleRequestState();
// Click clear and make sure the requests are gone
await EventUtils.sendMouseEvent({ type: "click" }, clearButton);
EventUtils.sendMouseEvent({ type: "click" }, clearButton);
assertNoRequestState();
// Load a second request and make sure they still show up
@ -50,7 +50,7 @@ add_task(async function() {
);
// Click clear and make sure the details pane closes
await EventUtils.sendMouseEvent({ type: "click" }, clearButton);
EventUtils.sendMouseEvent({ type: "click" }, clearButton);
assertNoRequestState();
ok(

View File

@ -30,7 +30,7 @@ add_task(async function() {
const fileHeader = document.querySelector(`#requests-list-file-header-box`);
const fileColumnResizer = fileHeader.querySelector(".column-resizer");
await EventUtils.sendMouseEvent({ type: "dblclick" }, fileColumnResizer);
EventUtils.sendMouseEvent({ type: "dblclick" }, fileColumnResizer);
// After resize - get fresh prefs for tests.
let columnsData = JSON.parse(
@ -47,7 +47,7 @@ add_task(async function() {
);
// Resizing `transferred` column.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector("#requests-list-transferred-button")
);

View File

@ -50,7 +50,7 @@ add_task(async function() {
await teardown(monitor);
async function testLastMenuItem(column) {
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector(`#requests-list-${column}-button`)
);

View File

@ -27,7 +27,7 @@ add_task(async function() {
await hideColumn(monitor, "status");
await hideColumn(monitor, "waterfall");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector("#requests-list-contentSize-button")
);

View File

@ -65,7 +65,7 @@ async function testWhiteSpaceContextMenuItem(column, document, monitor) {
);
info(`Right clicking on white-space in the header to get the context menu`);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector(".requests-list-headers")
);
@ -82,7 +82,7 @@ async function testVisibleColumnContextMenuItem(column, document, monitor) {
);
info(`Clicking context-menu item for ${column}`);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector("#requests-list-status-button") ||
document.querySelector("#requests-list-waterfall-button")
@ -133,7 +133,7 @@ async function testHiddenColumnContextMenuItem(column, document, monitor) {
);
info(`Clicking context-menu item for ${column}`);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelector("#requests-list-status-button") ||
document.querySelector("#requests-list-waterfall-button")

View File

@ -24,16 +24,16 @@ add_task(async function() {
await performRequests(monitor, tab, 12);
let wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
await wait;
testParamsTab1('{ "foo": "bar" }', "");
wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[1]
);
@ -41,7 +41,7 @@ add_task(async function() {
testParamsTab1('{ "foo": "bar" }', "");
wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[2]
);
@ -51,7 +51,7 @@ add_task(async function() {
let waitRows, waitSourceEditor;
waitRows = waitForDOM(document, "#request-panel tr.treeRow", 1);
waitSourceEditor = waitForDOM(document, "#request-panel .CodeMirror-code");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[3]
);
@ -60,7 +60,7 @@ add_task(async function() {
waitRows = waitForDOM(document, "#request-panel tr.treeRow", 1);
waitSourceEditor = waitForDOM(document, "#request-panel .CodeMirror-code");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[4]
);
@ -74,21 +74,21 @@ add_task(async function() {
1
);
waitSourceEditor = waitForDOM(document, "#request-panel .CodeMirror-code");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[5]
);
await Promise.all([waitAccordionItems, waitSourceEditor]);
testParamsTab2("?foo=bar", "text");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[6]
);
testParamsTab3();
wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[7]
);
@ -96,7 +96,7 @@ add_task(async function() {
testParamsTab1('{ "foo": "bar" }', "");
wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[8]
);

View File

@ -29,7 +29,7 @@ add_task(async function() {
for (const requestItem of document.querySelectorAll(".request-list-item")) {
const requestsListStatus = requestItem.querySelector(".status-code");
requestItem.scrollIntoView();
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
}

View File

@ -23,17 +23,17 @@ add_task(async function() {
await wait;
wait = waitForDOM(document, ".headers-overview");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await clickOnSidebarTab(document, "cookies");
clickOnSidebarTab(document, "cookies");
info("Check if Request-Cookies and Response-Cookies are sorted");
const expectedLabelValues = [

View File

@ -179,8 +179,8 @@ async function testForPlatform(tab, monitor, testData) {
const items = document.querySelectorAll(".request-list-item");
const itemIndex = items.length - 1;
await EventUtils.sendMouseEvent({ type: "mousedown" }, items[itemIndex]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent({ type: "mousedown" }, items[itemIndex]);
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -54,11 +54,8 @@ add_task(async function() {
const { document } = monitor.panelWin;
const items = document.querySelectorAll(".request-list-item");
await EventUtils.sendMouseEvent(
{ type: "mousedown" },
items[items.length - 1]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent({ type: "mousedown" }, items[items.length - 1]);
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -22,7 +22,7 @@ add_task(async function() {
tab.linkedBrowser.reload();
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -30,7 +30,7 @@ add_task(async function() {
const requestItem = getSortedRequests(store.getState())[0];
const { method, httpVersion, status, statusText } = requestItem;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);
@ -76,7 +76,7 @@ add_task(async function() {
"date: Sun, 3 May 2015 11:11:11 GMT",
].join("\n");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -19,11 +19,11 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[5]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[5]
);

View File

@ -21,54 +21,54 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, 7);
await testCopyUrlParamsHidden(0, false);
testCopyUrlParamsHidden(0, false);
await testCopyUrlParams(0, "a");
await testCopyPostDataHidden(0, false);
testCopyPostDataHidden(0, false);
await testCopyPostData(0, '{ "foo": "bar" }');
await testCopyUrlParamsHidden(1, false);
testCopyUrlParamsHidden(1, false);
await testCopyUrlParams(1, "a=b");
await testCopyPostDataHidden(1, false);
testCopyPostDataHidden(1, false);
await testCopyPostData(1, '{ "foo": "bar" }');
await testCopyUrlParamsHidden(2, false);
testCopyUrlParamsHidden(2, false);
await testCopyUrlParams(2, "a=b");
await testCopyPostDataHidden(2, false);
testCopyPostDataHidden(2, false);
await testCopyPostData(2, "foo=bar");
await testCopyUrlParamsHidden(3, false);
testCopyUrlParamsHidden(3, false);
await testCopyUrlParams(3, "a");
await testCopyPostDataHidden(3, false);
testCopyPostDataHidden(3, false);
await testCopyPostData(3, '{ "foo": "bar" }');
await testCopyUrlParamsHidden(4, false);
testCopyUrlParamsHidden(4, false);
await testCopyUrlParams(4, "a=b");
await testCopyPostDataHidden(4, false);
testCopyPostDataHidden(4, false);
await testCopyPostData(4, '{ "foo": "bar" }');
await testCopyUrlParamsHidden(5, false);
testCopyUrlParamsHidden(5, false);
await testCopyUrlParams(5, "a=b");
await testCopyPostDataHidden(5, false);
testCopyPostDataHidden(5, false);
await testCopyPostData(5, "?foo=bar");
await testCopyRequestDataLabel(5, "POST");
testCopyRequestDataLabel(5, "POST");
await testCopyUrlParamsHidden(6, true);
await testCopyPostDataHidden(6, true);
testCopyUrlParamsHidden(6, true);
testCopyPostDataHidden(6, true);
await testCopyPostDataHidden(7, false);
await testCopyRequestDataLabel(7, "PATCH");
testCopyPostDataHidden(7, false);
testCopyRequestDataLabel(7, "PATCH");
await testCopyPostDataHidden(8, false);
await testCopyRequestDataLabel(8, "PUT");
testCopyPostDataHidden(8, false);
testCopyRequestDataLabel(8, "PUT");
return teardown(monitor);
async function testCopyUrlParamsHidden(index, hidden) {
await EventUtils.sendMouseEvent(
function testCopyUrlParamsHidden(index, hidden) {
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]
);
@ -86,11 +86,11 @@ add_task(async function() {
}
async function testCopyUrlParams(index, queryString) {
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]
);
@ -103,12 +103,12 @@ add_task(async function() {
ok(true, "The url query string copied from the selected item is correct.");
}
async function testCopyPostDataHidden(index, hidden) {
await EventUtils.sendMouseEvent(
function testCopyPostDataHidden(index, hidden) {
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]
);
@ -125,12 +125,12 @@ add_task(async function() {
);
}
async function testCopyRequestDataLabel(index, method) {
await EventUtils.sendMouseEvent(
function testCopyRequestDataLabel(index, method) {
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]
);
@ -155,11 +155,11 @@ add_task(async function() {
const { formDataSections, requestPostData } = requests[index];
return formDataSections && requestPostData;
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]
);

View File

@ -21,11 +21,11 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[3]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[3]
);

View File

@ -21,11 +21,11 @@ add_task(async function() {
});
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -21,7 +21,7 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -37,7 +37,7 @@ add_task(async function() {
emptyClipboard();
info("Simulating context click on a first element of the request table");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -27,7 +27,7 @@ add_task(async function() {
const requestItem = document.querySelectorAll(".request-list-item")[0];
const requestsListStatus = requestItem.querySelector(".status-code");
requestItem.scrollIntoView();
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -44,13 +44,13 @@ add_task(async function() {
);
let wait = waitForDOM(document, "#headers-panel");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
wait = waitForDOM(document, "#response-panel .CodeMirror-code");
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
ok(

View File

@ -29,7 +29,7 @@ add_task(async function() {
const requestItem = document.querySelectorAll(".request-list-item")[0];
const requestsListStatus = requestItem.querySelector(".status-code");
requestItem.scrollIntoView();
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -46,14 +46,14 @@ add_task(async function() {
);
wait = waitForDOM(document, "#headers-panel");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
wait = waitForDOM(document, "#response-panel .accordion-item", 2);
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
wait = waitForDOM(document, "#response-panel .CodeMirror-code");

View File

@ -23,13 +23,13 @@ add_task(async function() {
const wait = waitUntil(
() => document.querySelectorAll(".tabpanel-summary-label")[0]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
return teardown(monitor);
});

View File

@ -24,7 +24,7 @@ add_task(async function() {
document.querySelector("#headers-panel .url-preview")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -29,7 +29,7 @@ add_task(async function() {
const urlRow = urlPreview.querySelector(".objectRow");
/* Test for copy on the url */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, urlRow);
EventUtils.sendMouseEvent({ type: "contextmenu" }, urlRow);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copy").click();
}, "http://example.com/browser/devtools/client/netmonitor/test/html_simple-test-page.html");
@ -37,7 +37,7 @@ add_task(async function() {
ok(true, "The copy action put expected url string into clipboard");
/* Test for copy all */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, urlRow);
EventUtils.sendMouseEvent({ type: "contextmenu" }, urlRow);
const expected = JSON.stringify(
{
GET: {
@ -92,7 +92,7 @@ add_task(async function() {
)[1];
/* Test for copy */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, httpSummaryValue);
EventUtils.sendMouseEvent({ type: "contextmenu" }, httpSummaryValue);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "headers-panel-context-menu-copy").click();
}, "Version: HTTP/1.1");
@ -100,7 +100,7 @@ add_task(async function() {
ok(true, "The copy action put expected text into clipboard");
/* Test for copy all */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, httpSummaryValue);
EventUtils.sendMouseEvent({ type: "contextmenu" }, httpSummaryValue);
const expected = JSON.stringify(
{
Status: "200OK",
@ -142,7 +142,7 @@ add_task(async function() {
"#response-panel .treeTable"
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await onResponsePanelReady;
const responsePanel = document.querySelector("#response-panel");
@ -151,7 +151,7 @@ add_task(async function() {
const stringRow = responsePanel.querySelectorAll(".stringRow")[0];
/* Test for copy an object */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, objectRow);
EventUtils.sendMouseEvent({ type: "contextmenu" }, objectRow);
const expected = JSON.stringify({ obj: { type: "string" } }, null, "\t");
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copy").click();
@ -160,7 +160,7 @@ add_task(async function() {
ok(true, "The copy action put expected json into clipboard");
/* Test for copy all */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, objectRow);
EventUtils.sendMouseEvent({ type: "contextmenu" }, objectRow);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copyall").click();
}, expected);
@ -168,7 +168,7 @@ add_task(async function() {
ok(true, "The copy all action put expected json into clipboard");
/* Test for copy a single row */
await EventUtils.sendMouseEvent({ type: "contextmenu" }, stringRow);
EventUtils.sendMouseEvent({ type: "contextmenu" }, stringRow);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copy").click();
}, "type: string");
@ -200,17 +200,17 @@ add_task(async function() {
await wait;
wait = waitForDOM(document, ".headers-overview");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await clickOnSidebarTab(document, "cookies");
clickOnSidebarTab(document, "cookies");
const cookiesPanel = document.querySelector("#cookies-panel");
@ -224,7 +224,7 @@ add_task(async function() {
];
for (let i = 0; i < objectRows.length; i++) {
const cur = objectRows[i];
await EventUtils.sendMouseEvent({ type: "contextmenu" }, cur);
EventUtils.sendMouseEvent({ type: "contextmenu" }, cur);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copy").click();
}, JSON.stringify(expectedResponseCookies[i], null, "\t"));
@ -233,7 +233,7 @@ add_task(async function() {
const expectedRequestCookies = ["bob: true", "foo: bar", "tom: cool"];
for (let i = 0; i < expectedRequestCookies.length; i++) {
const cur = stringRows[objectRows.length + i];
await EventUtils.sendMouseEvent({ type: "contextmenu" }, cur);
EventUtils.sendMouseEvent({ type: "contextmenu" }, cur);
await waitForClipboardPromise(function setup() {
getContextMenuItem(monitor, "properties-view-context-menu-copy").click();
}, expectedRequestCookies[i]);

View File

@ -28,9 +28,9 @@ add_task(async function() {
const waitForHeaders = waitUntil(() =>
document.querySelector(".headers-overview")
);
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
await waitForHeaders;
await EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
const firstRequestState = getSelectedRequest(store.getState());
const contextResend = getContextMenuItem(
monitor,

View File

@ -27,10 +27,10 @@ add_task(async function() {
const waitForHeaders = waitUntil(() =>
document.querySelector(".headers-overview")
);
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
await waitForHeaders;
await waitForRequestData(store, ["requestHeaders"]);
await EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
// Open "New Request" form
const contextResend = getContextMenuItem(

View File

@ -24,7 +24,7 @@ add_task(async function() {
// Confirm XHR request and click it
const xhrRequestItem = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequestItem);
EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequestItem);
const waitForHeaders = waitUntil(() =>
document.querySelector(".headers-overview")
);
@ -32,7 +32,7 @@ add_task(async function() {
const firstRequest = getSelectedRequest(store.getState());
// Open context menu and execute "Edit & Resend".
await EventUtils.sendMouseEvent({ type: "contextmenu" }, xhrRequestItem);
EventUtils.sendMouseEvent({ type: "contextmenu" }, xhrRequestItem);
getContextMenuItem(monitor, "request-list-context-resend").click();
// Wait for "Edit & Resend" panel to appear

View File

@ -22,7 +22,7 @@ add_task(async function() {
// Selects 1st XHR request
const xhrRequest = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, xhrRequest);
// Stores original request for comparison of values later
const { getSelectedRequest } = windowRequire(
@ -31,7 +31,7 @@ add_task(async function() {
const original = getSelectedRequest(store.getState());
// Context Menu > "Edit & Resend"
await EventUtils.sendMouseEvent({ type: "contextmenu" }, xhrRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, xhrRequest);
getContextMenuItem(monitor, "request-list-context-resend").click();
// 1) Wait for "Edit & Resend" panel to appear
@ -43,7 +43,7 @@ add_task(async function() {
// Selects cloned request
const clonedRequest = document.querySelectorAll(".request-list-item")[1];
await EventUtils.sendMouseEvent({ type: "mousedown" }, clonedRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, clonedRequest);
const cloned = getSelectedRequest(store.getState());
// Compares if the requests have the same cause type (XHR)

View File

@ -231,7 +231,7 @@ add_task(async function() {
await performRequestsInContent(REQUESTS_WITH_MEDIA_AND_FLASH_AND_WS);
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -256,7 +256,7 @@ add_task(async function() {
testFilterButtons(monitor, "all");
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
@ -264,84 +264,84 @@ add_task(async function() {
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// Reset filters
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-css-button")
);
testFilterButtons(monitor, "css");
await testContents([0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-js-button")
);
testFilterButtons(monitor, "js");
await testContents([0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-xhr-button")
);
testFilterButtons(monitor, "xhr");
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-fonts-button")
);
testFilterButtons(monitor, "fonts");
await testContents([0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-images-button")
);
testFilterButtons(monitor, "images");
await testContents([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-media-button")
);
testFilterButtons(monitor, "media");
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-ws-button")
);
testFilterButtons(monitor, "ws");
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -350,7 +350,7 @@ add_task(async function() {
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
// Text in filter box that matches nothing should hide all.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -358,7 +358,7 @@ add_task(async function() {
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// ASCII text in filter box that matches should filter out everything else.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -366,7 +366,7 @@ add_task(async function() {
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// ASCII text in filter box that matches should filter out everything else.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -374,7 +374,7 @@ add_task(async function() {
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// Test negative filtering ASCII text(only show unmatched items)
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -382,7 +382,7 @@ add_task(async function() {
await testContents([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
// Unicode text in filter box that matches should filter out everything else.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -391,7 +391,7 @@ add_task(async function() {
// Ditto, except the above is for a Unicode URI component, and this one is for
// a Unicode domain name.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -399,7 +399,7 @@ add_task(async function() {
await testContents([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);
// Test negative filtering Unicode text(only show unmatched items)
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -408,7 +408,7 @@ add_task(async function() {
// Ditto, except the above is for a Unicode URI component, and this one is for
// a Unicode domain name.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -419,11 +419,11 @@ add_task(async function() {
// Enable filtering for html and css; should show request of both type.
setFreetextFilter("");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-css-button")
);
@ -441,7 +441,7 @@ add_task(async function() {
await testContents([1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// Disable some filters. Only one left active.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-css-button")
);
@ -449,7 +449,7 @@ add_task(async function() {
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// Disable last active filter. Should toggle to all.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
@ -457,20 +457,20 @@ add_task(async function() {
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
// Enable few filters and click on all. Only "all" should be checked.
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-css-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-ws-button")
);
testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 1, 0]);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -493,10 +493,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent(
{ type: "mouseover" },
requestsListStatus
);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
}

View File

@ -152,7 +152,7 @@ add_task(async function() {
await performRequestsInContent(REQUESTS_WITH_MEDIA_AND_FLASH_AND_WS);
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -177,7 +177,7 @@ add_task(async function() {
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1]);
info("Testing html filtering.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
@ -232,7 +232,7 @@ add_task(async function() {
]);
info("Resetting filters.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
@ -283,10 +283,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent(
{ type: "mouseover" },
requestsListStatus
);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
}

View File

@ -47,7 +47,7 @@ add_task(async function() {
await performRequestsInContent(requests);
await wait;
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -72,7 +72,7 @@ add_task(async function() {
testContents([0, 1, 2, 3, 4, 5, 6], 7, 0);
info("Sorting by size, ascending.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector("#requests-list-contentSize-button")
);
@ -80,7 +80,7 @@ add_task(async function() {
testContents([6, 4, 5, 0, 1, 2, 3], 7, 6);
info("Testing html filtering.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);
@ -94,7 +94,7 @@ add_task(async function() {
await wait;
info("Testing html filtering again.");
await resetSorting();
resetSorting();
testFilterButtons(monitor, "html");
testContents([8, 13, 9, 11, 10, 12, 0, 4, 1, 5, 2, 6, 3, 7], 2, 13);
@ -105,7 +105,7 @@ add_task(async function() {
await wait;
info("Testing html filtering again.");
await resetSorting();
resetSorting();
testFilterButtons(monitor, "html");
testContents(
[12, 13, 20, 14, 16, 18, 15, 17, 19, 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11],
@ -115,12 +115,12 @@ add_task(async function() {
await teardown(monitor);
async function resetSorting() {
await EventUtils.sendMouseEvent(
function resetSorting() {
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector("#requests-list-initiator-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector("#requests-list-contentSize-button")
);

View File

@ -64,7 +64,7 @@ add_task(async function() {
testFilterButtons(monitor, "js");
ok(true, "Only the correct filter type was taken into consideration.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-html-button")
);

View File

@ -417,10 +417,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent(
{ type: "mouseover" },
requestsListStatus
);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
}

View File

@ -48,7 +48,7 @@ add_task(async function() {
const buttonEl = document.querySelector(
`.requests-list-filter-${button}-button`
);
await EventUtils.sendMouseEvent({ type: "click" }, buttonEl);
EventUtils.sendMouseEvent({ type: "click" }, buttonEl);
testStatus();
}
}

View File

@ -34,7 +34,7 @@ add_task(async function() {
interactiveRule: false,
labelRule: false,
});
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -23,7 +23,7 @@ add_task(async function() {
const wait = waitUntil(
() => document.querySelectorAll(".tabpanel-summary-label")[0]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -22,7 +22,7 @@ add_task(async function() {
await wait;
wait = waitUntil(() => document.querySelector(".headers-overview"));
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -39,7 +39,7 @@ async function verifyHeaders(monitor) {
info("Check if Request-Headers and Response-Headers are sorted");
const wait = waitForDOM(document, ".headers-overview");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);

View File

@ -164,7 +164,7 @@ add_task(async function() {
continue;
}
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(
".request-list-item .requests-list-initiator-lastframe"
@ -187,7 +187,7 @@ add_task(async function() {
validateRequests(EXPECTED_REQUESTS, monitor);
// Sort the requests by initiator and check the order
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector("#requests-list-initiator-button")
);

View File

@ -31,7 +31,7 @@ add_task(async function() {
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([wait, waitForPropsView]);

View File

@ -30,7 +30,7 @@ add_task(async function() {
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await onResponsePanelReady;

View File

@ -32,7 +32,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -64,7 +64,7 @@ add_task(async function() {
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([wait, waitForPropsView]);

View File

@ -27,7 +27,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -47,7 +47,7 @@ add_task(async function() {
const wait = waitForDOM(document, "#response-panel .CodeMirror-code");
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
const tabpanel = document.querySelector("#response-panel");

View File

@ -34,7 +34,7 @@ add_task(async function() {
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([onResponsePanelReady, onPropsViewReady]);
const tabpanel = document.querySelector("#response-panel");

View File

@ -34,7 +34,7 @@ add_task(async function() {
1
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([onResponsePanelReady, onPropsViewReady]);
const tabpanel = document.querySelector("#response-panel");

View File

@ -27,7 +27,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -55,7 +55,7 @@ add_task(async function() {
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([wait, waitForPropsView]);
testJsonSectionInResponseTab();

View File

@ -28,7 +28,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -56,7 +56,7 @@ add_task(async function() {
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([wait, waitForPropsView]);
testJsonSectionInResponseTab();

View File

@ -28,7 +28,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
}
@ -73,7 +73,7 @@ add_task(async function() {
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await Promise.all([wait, waitForPropsView]);
testJsonSectionInResponseTab(`"Hello JSONP!"`);
@ -90,7 +90,7 @@ add_task(async function() {
info("Testing second request");
wait = waitForDOM(document, "#response-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[1]
);

View File

@ -38,7 +38,7 @@ add_task(async function() {
const requestItem = document.querySelector(".request-list-item");
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
@ -56,7 +56,7 @@ add_task(async function() {
wait = waitForDOM(document, "#response-panel .accordion-item", 2);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "response");
clickOnSidebarTab(document, "response");
await wait;
wait = waitForDOM(document, "#response-panel .CodeMirror-code");

View File

@ -23,11 +23,11 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[2]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[2]
);

View File

@ -23,11 +23,11 @@ add_task(async function() {
// Execute requests.
await performRequests(monitor, tab, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[1]
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[1]
);

View File

@ -64,8 +64,8 @@ add_task(async function() {
async function openLastRequestInTab() {
const requestItems = document.querySelectorAll(".request-list-item");
const lastRequest = requestItems[requestItems.length - 1];
await EventUtils.sendMouseEvent({ type: "mousedown" }, lastRequest);
await EventUtils.sendMouseEvent({ type: "contextmenu" }, lastRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, lastRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, lastRequest);
await waitUntil(() =>
getContextMenuItem(monitor, "request-list-context-newtab")
);
@ -146,7 +146,7 @@ add_task(async function() {
const lastRequest = requestItems[requestItems.length - 1];
const onTabOpen = once(gBrowser.tabContainer, "TabOpen", false);
await EventUtils.sendMouseEvent({ type: "dblclick" }, lastRequest);
EventUtils.sendMouseEvent({ type: "dblclick" }, lastRequest);
await onTabOpen;
info("A new tab has been opened");

View File

@ -40,7 +40,7 @@ add_task(async function() {
"The details panel should at this point be visible."
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".sidebar-toggle")
);

View File

@ -46,34 +46,34 @@ add_task(async function() {
await wait;
info("Test with the first request in the list visible");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await testDetailsPanel(true, 0);
testDetailsPanel(true, 0);
info("Test with first request in the list not visible");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-js-button")
);
testFilterButtons(monitor, "js");
await testDetailsPanel(true, 2);
testDetailsPanel(true, 2);
info(
"Test with no request in the list visible i.e. no request match the filters"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-filter-all-button")
);
setFreetextFilter("foobar");
// The network details panel should not open as there are no available requests visible
await testDetailsPanel(false);
testDetailsPanel(false);
await teardown(monitor);
@ -86,7 +86,7 @@ add_task(async function() {
);
}
async function testDetailsPanel(shouldPanelOpen, selectedItemIndex = 0) {
function testDetailsPanel(shouldPanelOpen, selectedItemIndex = 0) {
// Expected default state should be panel closed
ok(
!document.querySelector(".sidebar-toggle"),
@ -131,7 +131,7 @@ add_task(async function() {
`The item index ${selectedItemIndex} should be selected in the requests menu.`
);
// Close the panel
await EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
} else {
ok(!toggleButton, "The pane toggle button should be not visible.");
is(

View File

@ -81,7 +81,7 @@ add_task(async function() {
"The first item should be selected in the requests menu."
);
await EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
is(
!!document.querySelector(".network-details-bar"),

View File

@ -21,13 +21,13 @@ add_task(async function() {
await performRequests(monitor, tab, 1);
const wait = waitForDOM(document, ".headers-overview");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
// The Params panel should render the following
// POSTed JSON data structure:

View File

@ -35,20 +35,20 @@ add_task(async function() {
});
// Click pause, load second request and make sure they don't show up.
await EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
await performPausedRequest(tab, monitor, toolbox);
ok(noRequest, "There should be no activity when paused.");
assertRequestCount(store, 1);
// Click pause again to resume monitoring. Load a third request
// and make sure they will show up.
await EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
await performRequestAndWait(tab, monitor);
assertRequestCount(store, 2);
// Click pause, reload the page and check that there are
// some requests. Page reload should auto-resume.
await EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
EventUtils.sendMouseEvent({ type: "click" }, pauseButton);
const networkEvents = waitForNetworkEvents(monitor, 1);
tab.linkedBrowser.reload();
await networkEvents;

View File

@ -32,7 +32,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
}
@ -69,11 +69,11 @@ add_task(async function() {
// Wait for all accordion items updated by react
const wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
await wait;
await testParamsTab("urlencoded");
@ -87,7 +87,7 @@ add_task(async function() {
document,
"#request-panel .CodeMirror-code"
);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[1]
);

View File

@ -25,11 +25,11 @@ add_task(async function() {
// Wait for all tree view updated by react
const wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
await wait;
const tabpanel = document.querySelector("#request-panel");

View File

@ -26,7 +26,7 @@ add_task(async function() {
// Wait for all tree view updated by react
let wait = waitForDOM(document, "#headers-panel .accordion-item", 3);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "headers");
clickOnSidebarTab(document, "headers");
await wait;
let tabpanel = document.querySelector("#headers-panel");
@ -72,7 +72,7 @@ add_task(async function() {
// Wait for all tree sections updated by react
wait = waitForDOM(document, "#request-panel .accordion-item", 2);
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
await wait;
tabpanel = document.querySelector("#request-panel");

View File

@ -35,7 +35,7 @@ add_task(async function() {
"#request-panel .CodeMirror-code"
);
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "request");
clickOnSidebarTab(document, "request");
await Promise.all([waitAccordionItems, waitSourceEditor]);
const tabpanel = document.querySelector("#request-panel");

View File

@ -25,37 +25,25 @@ add_task(async function() {
await performRequests(monitor, tab, 2);
let wait = waitForDOM(document, "#headers-panel .accordion-item", 2);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
wait = waitForDOM(document, "#responseHeaders textarea.raw-headers", 1);
await EventUtils.sendMouseEvent(
{ type: "click" },
getRawHeadersToggle("RESPONSE")
);
EventUtils.sendMouseEvent({ type: "click" }, getRawHeadersToggle("RESPONSE"));
await wait;
wait = waitForDOM(document, "#requestHeaders textarea.raw-headers", 1);
await EventUtils.sendMouseEvent(
{ type: "click" },
getRawHeadersToggle("REQUEST")
);
EventUtils.sendMouseEvent({ type: "click" }, getRawHeadersToggle("REQUEST"));
await wait;
testRawHeaderToggleStyle(true);
testShowRawHeaders(getSortedRequests(store.getState())[0]);
await EventUtils.sendMouseEvent(
{ type: "click" },
getRawHeadersToggle("RESPONSE")
);
await EventUtils.sendMouseEvent(
{ type: "click" },
getRawHeadersToggle("REQUEST")
);
EventUtils.sendMouseEvent({ type: "click" }, getRawHeadersToggle("RESPONSE"));
EventUtils.sendMouseEvent({ type: "click" }, getRawHeadersToggle("REQUEST"));
testRawHeaderToggleStyle(false);
testHideRawHeaders(document);

View File

@ -14,7 +14,7 @@ add_task(async function() {
const { document } = monitor.panelWin;
const wait = waitForNetworkEvents(monitor, 1);
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector(".requests-list-reload-notice-button")
);

View File

@ -55,10 +55,7 @@ add_task(async function() {
for (const requestItem of requestItems) {
requestItem.scrollIntoView();
const requestsListStatus = requestItem.querySelector(".status-code");
await EventUtils.sendMouseEvent(
{ type: "mouseover" },
requestsListStatus
);
EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
await waitUntil(() => requestsListStatus.title);
await waitForDOMIfNeeded(requestItem, ".requests-list-timings-total");
}

View File

@ -21,7 +21,7 @@ add_task(async function() {
// Select the image request
const imgRequest = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, imgRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, imgRequest);
// Stores original request for comparison of values later
const { getSelectedRequest } = windowRequire(
@ -30,7 +30,7 @@ add_task(async function() {
const origReq = getSelectedRequest(store.getState());
// Context Menu > "Resend"
await EventUtils.sendMouseEvent({ type: "contextmenu" }, imgRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, imgRequest);
getContextMenuItem(monitor, "request-list-context-resend-only").click();
await performRequests(monitor, tab, 1);

View File

@ -21,7 +21,7 @@ add_task(async function() {
// Selects 1st request
const firstRequest = document.querySelectorAll(".request-list-item")[0];
await EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
EventUtils.sendMouseEvent({ type: "mousedown" }, firstRequest);
// Stores original request for comparison of values later
const { getSelectedRequest } = windowRequire(
@ -31,7 +31,7 @@ add_task(async function() {
const waitForResentRequestEvent = waitForNetworkEvents(monitor, 1);
// Context Menu > "Resend"
await EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
EventUtils.sendMouseEvent({ type: "contextmenu" }, firstRequest);
getContextMenuItem(monitor, "request-list-context-resend-only").click();
await waitForResentRequestEvent;

View File

@ -29,7 +29,7 @@ add_task(async function() {
await wait;
store.dispatch(Actions.toggleNetworkDetails());
await clickOnSidebarTab(document, "security");
clickOnSidebarTab(document, "security");
await waitUntil(() =>
document.querySelector("#security-panel .security-info-value")
);

View File

@ -28,7 +28,7 @@ add_task(async function() {
store.dispatch(Actions.toggleNetworkDetails());
await waitUntil(() => document.querySelector("#security-tab"));
await clickOnSidebarTab(document, "security");
clickOnSidebarTab(document, "security");
await securityInfoLoaded;
const errormsg = document.querySelector(".security-info-value");

View File

@ -29,10 +29,10 @@ add_task(async function() {
await clickAndTestSecurityIcon();
info("Selecting headers panel again.");
await clickOnSidebarTab(document, "headers");
clickOnSidebarTab(document, "headers");
info("Sorting the items by filename.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "click" },
document.querySelector("#requests-list-file-button")
);

View File

@ -34,20 +34,20 @@ add_task(async function() {
info("Selecting secure request.");
wait = waitForDOM(document, ".tabs");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
await wait;
info("Selecting security tab.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelector("#security-tab")
);
info("Selecting insecure request.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[1]
);

View File

@ -68,7 +68,7 @@ add_task(async function() {
await onComplete;
info("Selecting the request.");
await EventUtils.sendMouseEvent(
EventUtils.sendMouseEvent(
{ type: "mousedown" },
document.querySelectorAll(".request-list-item")[0]
);
@ -89,7 +89,7 @@ add_task(async function() {
if (testcase.visibleOnSecurityInfo) {
// click security panel to lazy load the securityState
await waitUntil(() => document.querySelector("#security-tab"));
await clickOnSidebarTab(document, "security");
clickOnSidebarTab(document, "security");
await waitUntil(() =>
document.querySelector("#security-panel .security-info-value")
);

Some files were not shown because too many files have changed in this diff Show More