зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1557083) for causing browser_net_block.js to perma fail CLOSED TREE
Backed out changeset 82611a6d116f (bug 1557083) Backed out changeset 576da2d2bf32 (bug 1557083) Backed out changeset 613f24ecf1c3 (bug 1557083)
This commit is contained in:
Родитель
6298322b7f
Коммит
a70e37b142
|
@ -6,7 +6,6 @@
|
|||
|
||||
const {
|
||||
ADD_REQUEST,
|
||||
BLOCK_SELECTED_REQUEST_DONE,
|
||||
CLEAR_REQUESTS,
|
||||
CLONE_REQUEST,
|
||||
CLONE_SELECTED_REQUEST,
|
||||
|
@ -14,7 +13,6 @@ const {
|
|||
RIGHT_CLICK_REQUEST,
|
||||
SEND_CUSTOM_REQUEST,
|
||||
TOGGLE_RECORDING,
|
||||
UNBLOCK_SELECTED_REQUEST_DONE,
|
||||
UPDATE_REQUEST,
|
||||
} = require("../constants");
|
||||
const { getSelectedRequest, getRequestById } = require("../selectors/index");
|
||||
|
@ -111,16 +109,13 @@ function sendCustomRequest(connector, requestId = null) {
|
|||
* Tell the backend to block future requests that match the URL of the selected one.
|
||||
*/
|
||||
function blockSelectedRequestURL(connector, clickedRequest) {
|
||||
return async dispatch => {
|
||||
return () => {
|
||||
if (!clickedRequest) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { url } = clickedRequest;
|
||||
await connector.blockRequest({ url });
|
||||
dispatch({
|
||||
type: BLOCK_SELECTED_REQUEST_DONE,
|
||||
});
|
||||
connector.blockRequest({ url });
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -128,16 +123,13 @@ function blockSelectedRequestURL(connector, clickedRequest) {
|
|||
* Tell the backend to unblock future requests that match the URL of the selected one.
|
||||
*/
|
||||
function unblockSelectedRequestURL(connector, clickedRequest) {
|
||||
return async dispatch => {
|
||||
return () => {
|
||||
if (!clickedRequest) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { url } = clickedRequest;
|
||||
await connector.unblockRequest({ url });
|
||||
dispatch({
|
||||
type: UNBLOCK_SELECTED_REQUEST_DONE,
|
||||
});
|
||||
connector.unblockRequest({ url });
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ const actionTypes = {
|
|||
BATCH_ACTIONS: "BATCH_ACTIONS",
|
||||
BATCH_ENABLE: "BATCH_ENABLE",
|
||||
BATCH_FLUSH: "BATCH_FLUSH",
|
||||
BLOCK_SELECTED_REQUEST_DONE: "BLOCK_SELECTED_REQUEST_DONE",
|
||||
CLEAR_REQUESTS: "CLEAR_REQUESTS",
|
||||
CLEAR_TIMING_MARKERS: "CLEAR_TIMING_MARKERS",
|
||||
CLONE_REQUEST: "CLONE_REQUEST",
|
||||
|
@ -32,7 +31,6 @@ const actionTypes = {
|
|||
TOGGLE_COLUMN: "TOGGLE_COLUMN",
|
||||
TOGGLE_RECORDING: "TOGGLE_RECORDING",
|
||||
TOGGLE_REQUEST_FILTER_TYPE: "TOGGLE_REQUEST_FILTER_TYPE",
|
||||
UNBLOCK_SELECTED_REQUEST_DONE: "UNBLOCK_SELECTED_REQUEST_DONE",
|
||||
UPDATE_REQUEST: "UPDATE_REQUEST",
|
||||
WATERFALL_RESIZE: "WATERFALL_RESIZE",
|
||||
SET_COLUMNS_WIDTH: "SET_COLUMNS_WIDTH",
|
||||
|
|
|
@ -10,10 +10,6 @@ const {
|
|||
createStore,
|
||||
} = require("devtools/client/shared/vendor/redux");
|
||||
|
||||
const {
|
||||
waitUntilService,
|
||||
} = require("devtools/client/shared/redux/middleware/wait-service.js");
|
||||
|
||||
const { MIN_COLUMN_WIDTH, DEFAULT_COLUMN_WIDTH } = require("./constants");
|
||||
|
||||
// Middleware
|
||||
|
@ -66,8 +62,7 @@ function configureStore(connector, telemetry) {
|
|||
batching,
|
||||
recording(connector),
|
||||
throttling(connector),
|
||||
eventTelemetry(connector, telemetry),
|
||||
waitUntilService
|
||||
eventTelemetry(connector, telemetry)
|
||||
);
|
||||
|
||||
return createStore(rootReducer, initialState, middleware);
|
||||
|
|
|
@ -43,14 +43,8 @@ add_task(async function() {
|
|||
monitor,
|
||||
"request-list-context-block-url"
|
||||
);
|
||||
const onRequestBlocked = waitForDispatch(
|
||||
store,
|
||||
"BLOCK_SELECTED_REQUEST_END"
|
||||
);
|
||||
contextBlock.click();
|
||||
info("Wait for selected request to be blocked");
|
||||
await onRequestBlocked;
|
||||
info("Selected request is now blocked");
|
||||
info("Set request to blocked");
|
||||
}
|
||||
|
||||
// Reload to have one request in the list
|
||||
|
@ -78,15 +72,8 @@ add_task(async function() {
|
|||
monitor,
|
||||
"request-list-context-unblock-url"
|
||||
);
|
||||
const onRequestUnblocked = waitForDispatch(
|
||||
store,
|
||||
"UNBLOCK_SELECTED_REQUEST_END"
|
||||
);
|
||||
contextUnblock.click();
|
||||
|
||||
info("Wait for selected request to be unblocked");
|
||||
await onRequestUnblocked;
|
||||
info("Selected request is now unblocked");
|
||||
info("Set request to unblocked");
|
||||
}
|
||||
|
||||
// Reload to have one request in the list
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* import-globals-from ../../shared/test/shared-head.js */
|
||||
/* exported Toolbox, restartNetMonitor, teardown, waitForExplicitFinish,
|
||||
verifyRequestItemTarget, waitFor, waitForDispatch, testFilterButtons,
|
||||
verifyRequestItemTarget, waitFor, testFilterButtons,
|
||||
performRequestsInContent, waitForNetworkEvents, selectIndexAndWaitForSourceEditor,
|
||||
testColumnsAlignment, hideColumn, showColumn, performRequests, waitForRequestData */
|
||||
|
||||
|
@ -744,27 +744,6 @@ function waitFor(subject, eventName) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for an action of the provided type to be dispatched on the provided
|
||||
* store.
|
||||
*
|
||||
* @param {Object} store
|
||||
* The redux store (wait-service middleware required).
|
||||
* @param {String} type
|
||||
* Type of the action to wait for.
|
||||
*/
|
||||
function waitForDispatch(store, type) {
|
||||
return new Promise(resolve => {
|
||||
store.dispatch({
|
||||
type: "@@service/waitUntil",
|
||||
predicate: action => action.type === type,
|
||||
run: (dispatch, getState, action) => {
|
||||
resolve(action);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if a button for a filter of given type is the only one checked.
|
||||
*
|
||||
|
|
|
@ -229,13 +229,11 @@ const NetworkMonitorActor = ActorClassWithSpec(networkMonitorSpec, {
|
|||
onBlockRequest({ data }) {
|
||||
const { filter } = data;
|
||||
this.observer.blockRequest(filter);
|
||||
this.messageManager.sendAsyncMessage("debug:block-request:response");
|
||||
},
|
||||
|
||||
onUnblockRequest({ data }) {
|
||||
const { filter } = data;
|
||||
this.observer.unblockRequest(filter);
|
||||
this.messageManager.sendAsyncMessage("debug:unblock-request:response");
|
||||
},
|
||||
|
||||
onGetNetworkEventActor({ data }) {
|
||||
|
|
|
@ -1911,39 +1911,6 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Send a message to all the netmonitor message managers, and resolve when
|
||||
* all of them replied with the expected responseName message.
|
||||
*
|
||||
* @param {String} messageName
|
||||
* Name of the message to send via the netmonitor message managers.
|
||||
* @param {String} responseName
|
||||
* Name of the message that should be received when the message has
|
||||
* been processed by the netmonitor instance.
|
||||
* @param {Object} args
|
||||
* argument object passed with the initial message.
|
||||
*/
|
||||
async _sendMessageToNetmonitors(messageName, responseName, args) {
|
||||
if (!this.netmonitors) {
|
||||
return;
|
||||
}
|
||||
await Promise.all(
|
||||
this.netmonitors.map(({ messageManager }) => {
|
||||
const onResponseReceived = new Promise(resolve => {
|
||||
messageManager.addMessageListener(
|
||||
responseName,
|
||||
function onResponse() {
|
||||
messageManager.removeMessageListener(responseName, onResponse);
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
messageManager.sendAsyncMessage(messageName, args);
|
||||
return onResponseReceived;
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Block a request based on certain filtering options.
|
||||
*
|
||||
|
@ -1955,11 +1922,13 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
* An object containing a `url` key with a URL to block.
|
||||
*/
|
||||
async blockRequest(filter) {
|
||||
await this._sendMessageToNetmonitors(
|
||||
"debug:block-request",
|
||||
"debug:block-request:response",
|
||||
{ filter }
|
||||
);
|
||||
if (this.netmonitors) {
|
||||
for (const { messageManager } of this.netmonitors) {
|
||||
messageManager.sendAsyncMessage("debug:block-request", {
|
||||
filter,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
},
|
||||
|
@ -1975,11 +1944,13 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
* An object containing a `url` key with a URL to unblock.
|
||||
*/
|
||||
async unblockRequest(filter) {
|
||||
await this._sendMessageToNetmonitors(
|
||||
"debug:unblock-request",
|
||||
"debug:unblock-request:response",
|
||||
{ filter }
|
||||
);
|
||||
if (this.netmonitors) {
|
||||
for (const { messageManager } of this.netmonitors) {
|
||||
messageManager.sendAsyncMessage("debug:unblock-request", {
|
||||
filter,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче