Closed Bug 1694140 Opened 3 years ago Closed 3 years ago

Reduce usage of TargetFactory.forTab to interact with the toolbox

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

(7 files, 1 obsolete file)

In many devtools tests, we use TargetFactory::forTab in order to get or create a cached target for a given tab.

However as we want to move away from targets and go to descriptors, relying on those APIs becomes a problem. Associating a tab to a target means we need to update it everytime the top level target changes, which is unnecessarily complex.

Most call sites for forTab in tests use it only to pass it to gDevTools.showToolbox/getToolbox/closeToolbox. Instead we can reuse gDevTools.showToolboxForTab (being introduced in Bug 1688688) and add variants for get & close.

This should make refactoring the TargetFactory easier.

Attachment #9204576 - Attachment is obsolete: true
Blocks: 1694886
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5f6688e8fe4c
[devtools] Add getToolboxForTab and closeToolboxForTab helpers on gDevTools r=ochameau
https://hg.mozilla.org/integration/autoland/rev/6beb9dd48ef3
[devtools] Stop using TargetFactory.forTab in devtools code r=perftest-reviewers,ochameau
https://hg.mozilla.org/integration/autoland/rev/299f17e9cb6f
[devtools] Stop using TargetFactory forTab in devtools browser mochitests r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/45a8dc952aba
[devtools] Stop using TargetFactory.forTab outside of devtools r=rpl,ochameau
https://hg.mozilla.org/integration/autoland/rev/0b8f857e3f90
[devtools] Remove unused getTargetForTab helper on gDevTools r=ochameau
https://hg.mozilla.org/integration/autoland/rev/74adaced5c0a
[devtools] Stop using TargetFactory:forTab in netmonitor to retrieve the parent toolbox r=bomsy,ochameau
https://hg.mozilla.org/integration/autoland/rev/d5a70a3143ad
[devtools] Rename TargetFactory to TabTargetFactory and update filename r=ochameau
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84577250aaac
[devtools] Add getToolboxForTab and closeToolboxForTab helpers on gDevTools r=ochameau
https://hg.mozilla.org/integration/autoland/rev/d65518e8bd55
[devtools] Stop using TargetFactory.forTab in devtools code r=perftest-reviewers,ochameau
https://hg.mozilla.org/integration/autoland/rev/e62d2c1bbeca
[devtools] Stop using TargetFactory forTab in devtools browser mochitests r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/a0c0153d96de
[devtools] Stop using TargetFactory.forTab outside of devtools r=rpl,ochameau
https://hg.mozilla.org/integration/autoland/rev/413192185bce
[devtools] Remove unused getTargetForTab helper on gDevTools r=ochameau
https://hg.mozilla.org/integration/autoland/rev/4963e0380972
[devtools] Stop using TargetFactory:forTab in netmonitor to retrieve the parent toolbox r=bomsy,ochameau
https://hg.mozilla.org/integration/autoland/rev/4694d0a659ac
[devtools] Rename TargetFactory to TabTargetFactory and update filename r=ochameau
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27931 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: