зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ebf35b54b3
Коммит
8440986b83
|
@ -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 };
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче