Closed Bug 1694886 Opened 5 years ago Closed 5 years ago

Extract DevTools test helper getTargetForTab(tab) to shared-head.js

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox88 fixed)

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(1 file)

See https://phabricator.services.mozilla.com/D106037#inline-593121

We could extract the getTargetForTab(tab) test helper from devtools/shared/webconsole/test/browser/head.js

async function getTargetForTab(tab) {
  const target = await TabTargetFactory.forTab(tab);
  info("Attaching to the active tab.");
  await target.attach();
  return target;
}

move it to shared-head and then reuse it in all the mochitests importing shared-head which do very similar things: https://searchfox.org/mozilla-central/search?q=target.attach%28&path=devtools%2F**%2Ftest&case=false&regexp=false

Summary: Extract → Extract DevTools test helper getTargetForTab(tab) to shared-head.js
Blocks: 1694906
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1b7367a27d9a [devtools] Extract test helper getTargetForTab(tab) to shared-head.js r=nchevobbe
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8bec65732c5 [devtools] Extract test helper getTargetForTab(tab) to shared-head.js r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: