Closed
Bug 1509315
Opened 6 years ago
Closed 6 years ago
Refactor all tests involving a real tab to use TargetFactory.forTab to create a target front
Categories
(DevTools :: Framework, enhancement, P2)
DevTools
Framework
Tracking
(firefox65 fixed)
RESOLVED
FIXED
Firefox 65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
(Whiteboard: dt-fission)
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
For now, most of the tests are using TargetFactory.forTab for accessing to the target front, but there is still a couple manually creating only the front and not a Target by create its own DebuggerClient, querying listTabs manually and calling DebuggerClient.attachTarget by itself. In order to ease the refactoring coming in bug 1506548, it would be great to reduce the number of usages of listTabs. Such cleanup would reduce quite significantly the number of callsites.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Severity: normal → enhancement
Priority: -- → P2
Whiteboard: dt-fission
Assignee | ||
Comment 1•6 years ago
|
||
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=213448387&revision=0e0b06f4c19352a44b9d05211dfdc1892276e1d4
Assignee | ||
Comment 2•6 years ago
|
||
For now, we only pass { actor } for all tab target fronts created via DebuggerClient.attachTarget, whereas parent process target fronts were passing the full form from RootFront.getProcess. MozReview-Commit-ID: 1H2NxFv8glY
Assignee | ||
Comment 3•6 years ago
|
||
There is 4 patterns here: * Tests using attachThreadActorForUrl like event-listeners ones. I augmented this helper method to call TargetFactory. * Tests using attachTargetActorForUrl like debugger-statement, dbg-navigation and target-scoped-actor. Uses TargetFactory directly. * Tests using connectDebuggerClient like navigateEvents and spaw_actor_in_parent. Uses TargetFactory directly. * All the others, where creating DebuggerClient on their own, and calling listTabs+attachTarget. They now use TargetFactory directly. A note about webconsole-helpers, only consoleClient attribute was used from tests using this helper. Also, in various tests I remove the call to client.destroy, that's because shared-head will close all the tabs/toolboxes and it should lead to target/client destruction. Finally, debugger-statement now request the thread actor via the client instead of manual request, it should help the refactoring to a front! MozReview-Commit-ID: 2ah4UmSjuoi Depends on D12730
Assignee | ||
Comment 4•6 years ago
|
||
I also removed the get root form leftover. MozReview-Commit-ID: DxPwG9a5YAG Depends on D12731
Assignee | ||
Comment 5•6 years ago
|
||
These tests are calling listTabs, but that is no longer necessary thanks to rootForm being automatically managed within RootFront. MozReview-Commit-ID: AmC6dTIJjiY Depends on D12732
Assignee | ||
Comment 6•6 years ago
|
||
MozReview-Commit-ID: 2jIm73AiIPN Depends on D12733
Assignee | ||
Comment 7•6 years ago
|
||
Ideally, it would use TargetFactory. But as that's mochitest chrome, we don't have natural access to gBrowser/firefox tab. MozReview-Commit-ID: 4nrfFZu6jAU Depends on D12734
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ce2018b0349d Pass the full target form to all BrowsingContextTargetFront instances. r=yulia https://hg.mozilla.org/integration/autoland/rev/18f76c415505 Use TargetFactory.forTab for creating targets in tests. r=yulia https://hg.mozilla.org/integration/autoland/rev/322f2dd20299 Remove leftover from debugger head.js file. r=yulia https://hg.mozilla.org/integration/autoland/rev/3eadd3d05800 Remove unecessary calls to listTabs. r=yulia https://hg.mozilla.org/integration/autoland/rev/30bc5b0c60eb Refactor console attachConsole test helpers to async. r=yulia https://hg.mozilla.org/integration/autoland/rev/5e887c4ebd79 Make the console test helper use getTab instead of listTabs. r=yulia
Comment 9•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ce2018b0349d https://hg.mozilla.org/mozilla-central/rev/18f76c415505 https://hg.mozilla.org/mozilla-central/rev/322f2dd20299 https://hg.mozilla.org/mozilla-central/rev/3eadd3d05800 https://hg.mozilla.org/mozilla-central/rev/30bc5b0c60eb https://hg.mozilla.org/mozilla-central/rev/5e887c4ebd79
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
You need to log in
before you can comment on or make changes to this bug.
Description
•