Bug 1619622 - Return only the thread front from Target.attachThread. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D65124

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2020-03-11 13:35:46 +00:00
Родитель fcbaa10019
Коммит b7bd94a4f5
13 изменённых файлов: 16 добавлений и 16 удалений

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

@ -48,7 +48,7 @@ async function attachTargets(targetLists, args) {
// But workers targets are still only managed by the debugger codebase
// and so we have to attach their thread actor
if (!threadFront) {
[, threadFront] = await targetFront.attachThread({
threadFront = await targetFront.attachThread({
...defaultThreadOptions(),
...args.options,
});

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

@ -55,7 +55,7 @@ add_task(async function() {
const descriptorFront = await gClient.mainRoot.getMainProcess();
const front = await descriptorFront.getTarget();
await front.attach();
const [, threadFront] = await front.attachThread();
const threadFront = await front.attachThread();
gThreadFront = threadFront;
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:mozilla");

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

@ -39,7 +39,7 @@ async function testChromeTab() {
const target = await TargetFactory.forTab(tab);
await target.attach();
const [, threadFront] = await target.attachThread();
const threadFront = await target.attachThread();
await threadFront.resume();
const { sources } = await threadFront.getSources();
@ -108,7 +108,7 @@ async function testMainProcess() {
const target = await targetDescriptor.getTarget();
await target.attach();
const [, threadFront] = await target.attachThread();
const threadFront = await target.attachThread();
await threadFront.resume();
const { sources } = await threadFront.getSources();
ok(

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

@ -729,7 +729,7 @@ Toolbox.prototype = {
_attachAndResumeThread: async function(target) {
const options = defaultThreadOptions();
const [, threadFront] = await target.attachThread(options);
const threadFront = await target.attachThread(options);
try {
await threadFront.resume();

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

@ -44,7 +44,7 @@ async function testEarlyDebuggerStatement(client, tab, targetFront) {
client.off("paused", onPaused);
// Now attach and resume...
const [, threadFront] = await targetFront.attachThread();
const threadFront = await targetFront.attachThread();
await threadFront.resume();
ok(true, "Pause wasn't called before we've attached.");

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

@ -265,7 +265,7 @@ this.removeTab = function removeTab(tab, win) {
async function attachThreadActorForTab(tab) {
const target = await TargetFactory.forTab(tab);
await target.attach();
const [, threadFront] = await target.attachThread();
const threadFront = await target.attachThread();
await threadFront.resume();
return { client: target.client, threadFront };
}

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

@ -113,7 +113,7 @@ Once the application is attached to a tab, it can attach to its thread in order
// Assuming the application is already attached to the tab, and response is the first
// argument of the attachTarget callback.
client.attachThread(response.threadActor).then(function([response, threadFront]) {
client.attachThread(response.threadActor).then(function(threadFront) {
if (!threadFront) {
return;
}
@ -178,7 +178,7 @@ function debugTab() {
// Attach to the tab.
targetFront.attach().then(() => {
// Attach to the thread (context).
targetFront.attachThread().then(([response, threadFront]) => {
targetFront.attachThread().then((threadFront) => {
// Attach listeners for thread events.
threadFront.on("paused", onPause);
threadFront.on("resumed", fooListener);

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

@ -53,7 +53,7 @@ add_task(async function test_webextension_addon_debugging_connect() {
// When running in oop mode we can explicitly attach the thread without locking
// the main process.
const [, threadFront] = await addonTarget.attachThread();
const threadFront = await addonTarget.attachThread();
ok(threadFront, "Got a threadFront for the target addon");
is(threadFront.paused, true, "The addon threadActor is paused");

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

@ -791,7 +791,7 @@ async function setupTestFromUrl(url) {
const targetFront = findTab(tabs, "test");
await targetFront.attach();
const [, threadFront] = await attachThread(targetFront);
const threadFront = await attachThread(targetFront);
await resume(threadFront);
const sourceUrl = getFileUrl(url);

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

@ -11,7 +11,7 @@ add_task(
threadFrontTest(async ({ threadFront, debuggee, client, targetFront }) => {
await threadFront.detach();
Assert.equal(threadFront.state, "detached");
const [, newThreadFront] = await targetFront.attachThread({});
const newThreadFront = await targetFront.attachThread({});
Assert.notEqual(threadFront, newThreadFront);
Assert.equal(newThreadFront.state, "paused");
Assert.equal(targetFront.threadFront, newThreadFront);

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

@ -38,7 +38,7 @@ add_task(async function() {
// Even though we have no tabs, getMainProcess gives us the chrome debugger.
const targetDescriptor = await client.mainRoot.getMainProcess();
const front = await targetDescriptor.getTarget();
const [, threadFront] = await front.attachThread();
const threadFront = await front.attachThread();
// tell the thread to do the initial resume. This would cause the
// xpcshell test harness to resume and load the file under test.

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

@ -361,7 +361,7 @@ function TargetMixin(parentClass) {
);
}
this.threadFront = await this.getFront("thread");
const result = await this.threadFront.attach(options);
await this.threadFront.attach(options);
this.threadFront.on("newSource", this._onNewSource);
@ -369,7 +369,7 @@ function TargetMixin(parentClass) {
// wait for the thread to be attached can resume.
this._resolveOnThreadAttached();
return [result, this.threadFront];
return this.threadFront;
}
// Listener for "newSource" event fired by the thread actor

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

@ -83,7 +83,7 @@ var _attachConsole = async function(listeners, attachToTab, attachToWorker) {
// Attach the Target and the target thread in order to instantiate the console client.
await target.attach();
const [, threadFront] = await target.attachThread();
const threadFront = await target.attachThread();
await threadFront.resume();
const webConsoleFront = await target.getFront("console");