Backed out changeset 26d2f8e018b5 (bug 1492265) for failing xpcshell at devtools/server/tests/unit/test_promises_actor_attach.js a CLOSED TREE

--HG--
extra : amend_source : 05b3fe80cc8b79bebb697cddbe9ad22deb4261fc
This commit is contained in:
Andreea Pavel 2018-10-08 19:16:21 +03:00
Родитель ca71a35fa1
Коммит 3764388b3e
3 изменённых файлов: 10 добавлений и 29 удалений

Просмотреть файл

@ -229,10 +229,8 @@ function TabTarget({ form, client, chrome, tab = null }) {
} else {
// browser content toolbox's form will be of the form:
// server0.conn0.content-process0/contentProcessTarget7
// while xpcshell debugging will be:
// server1.conn0.contentProcessTarget7
const isContentProcessTarget =
this._form.actor.match(/conn\d+\.(content-process\d+\/)?contentProcessTarget\d+/);
this._form.actor.match(/conn\d+\.content-process\d+\/contentProcessTarget\d+/);
this._isBrowsingContext = !this.isLegacyAddon && !isContentProcessTarget;
}

Просмотреть файл

@ -14,10 +14,6 @@ const { DebuggerServer } = require("devtools/server/main");
loader.lazyRequireGetter(this, "ChromeWindowTargetActor",
"devtools/server/actors/targets/chrome-window", true);
loader.lazyRequireGetter(this, "ContentProcessTargetActor",
"devtools/server/actors/targets/content-process", true);
loader.lazyRequireGetter(this, "ParentProcessTargetActor",
"devtools/server/actors/targets/parent-process", true);
/* Root actor for the remote debugging protocol. */
@ -525,30 +521,16 @@ RootActor.prototype = {
// If the request doesn't contains id parameter or id is 0
// (id == 0, based on onListProcesses implementation)
if ((!("id" in request)) || request.id === 0) {
// Check if we are running on xpcshell. hiddenDOMWindow is going to throw on it.
// When running on xpcshell, there is no valid browsing context to attach to
// and so ParentProcessTargetActor doesn't make sense as it inherits from
// BrowsingContextTargetActor. So instead use ContentProcessTargetActor, which
// matches xpcshell needs.
let isXpcshell = true;
try {
isXpcshell = !Services.wm.getMostRecentWindow(null) &&
!Services.appShell.hiddenDOMWindow;
} catch (e) {}
if (!isXpcshell && this._parentProcessTargetActor &&
(!this._parentProcessTargetActor.docShell ||
this._parentProcessTargetActor.docShell.isBeingDestroyed)) {
if (this._parentProcessTargetActor && (!this._parentProcessTargetActor.docShell ||
this._parentProcessTargetActor.docShell.isBeingDestroyed)) {
this._parentProcessTargetActor.destroy();
this._parentProcessTargetActor = null;
}
if (!this._parentProcessTargetActor) {
// Create the target actor for the parent process
if (isXpcshell) {
this._parentProcessTargetActor = new ContentProcessTargetActor(this.conn);
} else {
this._parentProcessTargetActor = new ParentProcessTargetActor(this.conn);
}
// Create a ParentProcessTargetActor for the parent process
const { ParentProcessTargetActor } =
require("devtools/server/actors/targets/parent-process");
this._parentProcessTargetActor = new ParentProcessTargetActor(this.conn);
this._globalActorPool.manage(this._parentProcessTargetActor);
}

Просмотреть файл

@ -28,8 +28,9 @@ add_task(async function() {
// Even though we have no tabs, getProcess gives us the chromeDebugger.
const response = await client.getProcess();
const { chromeDebugger } = response.form;
const [, threadClient] = await client.attachThread(chromeDebugger);
const actor = response.form.actor;
const [, tabClient] = await client.attachTarget(actor);
const [, threadClient] = await tabClient.attachThread(null);
const onResumed = new Promise(resolve => {
threadClient.addOneTimeListener("paused", (event, packet) => {
equal(packet.why.type, "breakpoint",