mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Backed out 3 changesets (bug 1687205, bug 1687192, bug 1665383) for causing devtools failures in browser_net_block-csp.js CLOSED TREE
Backed out changeset 812caf90c2c5 (bug 1687192) Backed out changeset 68f676381ab4 (bug 1687205) Backed out changeset 34dd7e523954 (bug 1665383)
This commit is contained in:
parent
5077359d23
commit
77bb8db1ff
@ -518,44 +518,38 @@ class FirefoxDataProvider {
|
||||
// Emit event that tell we just start fetching some data
|
||||
this.emitForTests(EVENTS[updatingEventName], actor);
|
||||
|
||||
let response;
|
||||
if (
|
||||
clientMethodName == "getStackTrace" &&
|
||||
this.resourceWatcher.hasResourceWatcherSupport(
|
||||
this.resourceWatcher.TYPES.NETWORK_EVENT_STACKTRACE
|
||||
)
|
||||
) {
|
||||
const requestInfo = this.stackTraceRequestInfoByActorID.get(
|
||||
actor.replace("-clone", "")
|
||||
);
|
||||
const { stacktrace } = await this._getStackTraceFromWatcher(requestInfo);
|
||||
response = { from: actor, stacktrace };
|
||||
} else {
|
||||
response = await new Promise((resolve, reject) => {
|
||||
// Do a RDP request to fetch data from the actor.
|
||||
if (typeof this.webConsoleFront[clientMethodName] === "function") {
|
||||
// Make sure we fetch the real actor data instead of cloned actor
|
||||
// e.g. CustomRequestPanel will clone a request with additional '-clone' actor id
|
||||
this.webConsoleFront[clientMethodName](
|
||||
actor.replace("-clone", ""),
|
||||
res => {
|
||||
if (res.error) {
|
||||
reject(
|
||||
new Error(
|
||||
`Error while calling method ${clientMethodName}: ${res.message}`
|
||||
)
|
||||
);
|
||||
}
|
||||
resolve(res);
|
||||
let response = await new Promise((resolve, reject) => {
|
||||
// Do a RDP request to fetch data from the actor.
|
||||
if (
|
||||
clientMethodName == "getStackTrace" &&
|
||||
this.resourceWatcher.hasResourceWatcherSupport(
|
||||
this.resourceWatcher.TYPES.NETWORK_EVENT_STACKTRACE
|
||||
)
|
||||
) {
|
||||
const requestInfo = this.stackTraceRequestInfoByActorID.get(actor);
|
||||
resolve(this._getStackTraceFromWatcher(requestInfo));
|
||||
} else if (typeof this.webConsoleFront[clientMethodName] === "function") {
|
||||
// Make sure we fetch the real actor data instead of cloned actor
|
||||
// e.g. CustomRequestPanel will clone a request with additional '-clone' actor id
|
||||
this.webConsoleFront[clientMethodName](
|
||||
actor.replace("-clone", ""),
|
||||
res => {
|
||||
if (res.error) {
|
||||
reject(
|
||||
new Error(
|
||||
`Error while calling method ${clientMethodName}: ${res.message}`
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
reject(
|
||||
new Error(`Error: No such client method '${clientMethodName}'!`)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
resolve(res);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
reject(
|
||||
new Error(`Error: No such client method '${clientMethodName}'!`)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// Restore clone actor id
|
||||
if (actor.includes("-clone")) {
|
||||
|
@ -585,7 +585,7 @@ function messages(
|
||||
? [{ id: action.id, data: action.data }]
|
||||
: action.updates;
|
||||
for (const { id, data } of updates) {
|
||||
const request = newState.networkMessagesUpdateById[id];
|
||||
const request = networkMessagesUpdateById[id];
|
||||
if (!request) {
|
||||
continue;
|
||||
}
|
||||
|
@ -61,29 +61,6 @@ describe("Network message reducer:", () => {
|
||||
expect(networkUpdates.message1.requestHeaders).toBe(headers);
|
||||
});
|
||||
|
||||
it("makes sure multiple HTTP updates of same request does not override", () => {
|
||||
dispatch(
|
||||
actions.networkUpdateRequests([
|
||||
{
|
||||
id: "message1",
|
||||
data: {
|
||||
stacktrace: [{}],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "message1",
|
||||
data: {
|
||||
requestHeaders: { headers: [] },
|
||||
},
|
||||
},
|
||||
])
|
||||
);
|
||||
|
||||
const networkUpdates = getAllNetworkMessagesUpdateById(getState());
|
||||
expect(networkUpdates.message1.requestHeaders).toNotBe(undefined);
|
||||
expect(networkUpdates.message1.stacktrace).toNotBe(undefined);
|
||||
});
|
||||
|
||||
it("adds fetched HTTP security info", () => {
|
||||
const securityInfo = {
|
||||
state: "insecure",
|
||||
|
@ -137,7 +137,9 @@ const NetworkContentActor = ActorClassWithSpec(networkContentSpec, {
|
||||
const stacktrace = this.networkEventStackTraceWatcher.getStackTrace(
|
||||
resourceId
|
||||
);
|
||||
return WebConsoleUtils.removeFramesAboveDebuggerEval(stacktrace);
|
||||
return {
|
||||
stacktrace: WebConsoleUtils.removeFramesAboveDebuggerEval(stacktrace),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -145,8 +145,10 @@ exports.WatcherActor = protocol.ActorClassWithSpec(watcherSpec, {
|
||||
[Resources.TYPES.LOCAL_STORAGE]: hasBrowserElement,
|
||||
[Resources.TYPES.SESSION_STORAGE]: hasBrowserElement,
|
||||
[Resources.TYPES.PLATFORM_MESSAGE]: true,
|
||||
[Resources.TYPES.NETWORK_EVENT]: hasBrowserElement,
|
||||
[Resources.TYPES.NETWORK_EVENT_STACKTRACE]: hasBrowserElement,
|
||||
[Resources.TYPES.NETWORK_EVENT]:
|
||||
enableServerWatcher && hasBrowserElement,
|
||||
[Resources.TYPES.NETWORK_EVENT_STACKTRACE]:
|
||||
enableServerWatcher && hasBrowserElement,
|
||||
[Resources.TYPES.STYLESHEET]:
|
||||
enableServerWatcher && hasBrowserElement,
|
||||
[Resources.TYPES.SOURCE]: hasBrowserElement,
|
||||
|
@ -17,10 +17,8 @@ const networkContentSpec = generateActorSpec({
|
||||
},
|
||||
getStackTrace: {
|
||||
request: { resourceId: Arg(0) },
|
||||
response: {
|
||||
// stacktrace is an "array:string", but not always.
|
||||
stacktrace: RetVal("json"),
|
||||
},
|
||||
// stacktrace is an "array:string", but not always.
|
||||
response: RetVal("json"),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user