Bug 1682780 - [devtools] Remove unused callback arguments from xpshell debugger test helpers. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D99918
This commit is contained in:
Alexandre Poirot 2021-01-07 13:08:13 +00:00
Родитель ebf35b54b3
Коммит 8440986b83
1 изменённых файлов: 8 добавлений и 12 удалений

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

@ -361,7 +361,7 @@ function addTestGlobal(name, server = DevToolsServer) {
}
// List the DevToolsClient |client|'s tabs, look for one whose title is
// |title|, and apply |callback| to the packet's entry for that tab.
// |title|.
async function getTestTab(client, title) {
const tabs = await client.mainRoot.listTabs();
for (const tab of tabs) {
@ -382,10 +382,9 @@ async function attachTestTab(client, title) {
}
// Attach to |client|'s tab whose title is |title|, and then attach to
// that tab's thread. Pass |callback| the thread attach response packet, a
// TargetFront referring to the tab, and a ThreadFront referring to the
// thread.
async function attachTestThread(client, title, callback = () => {}) {
// that tab's thread. Return the TargetFront referring to the tab,
// and a ThreadFront referring to the thread.
async function attachTestThread(client, title) {
const targetFront = await attachTestTab(client, title);
const threadFront = await targetFront.getFront("thread");
const onPaused = threadFront.once("paused");
@ -396,18 +395,15 @@ async function attachTestThread(client, title, callback = () => {}) {
Assert.equal(threadFront.state, "paused", "Thread client is paused");
Assert.ok("why" in response);
Assert.equal(response.why.type, "attached");
callback(response, targetFront, threadFront);
return { targetFront, threadFront };
}
// Attach to |client|'s tab whose title is |title|, attach to the tab's
// thread, and then resume it. Pass |callback| the thread's response to
// the 'resume' packet, a TargetFront for the tab, and a ThreadFront for the
// thread.
async function attachTestTabAndResume(client, title, callback = () => {}) {
// thread, and then resume it. Return the TargetFront for the tab,
// and a ThreadFront for the thread.
async function attachTestTabAndResume(client, title) {
const { targetFront, threadFront } = await attachTestThread(client, title);
const response = await threadFront.resume();
callback(response, targetFront, threadFront);
await threadFront.resume();
return { targetFront, threadFront };
}