Bug 1605743: Update target front when starting to listen. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D87225
This commit is contained in:
Daisuke Akatsuka 2020-08-17 11:52:45 +00:00
parent 94c492e868
commit 35bbacb047
3 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,6 @@ skip-if = debug # Window leaks: bug 1575332
[browser_dbg-expressions-focus.js]
[browser_dbg-expressions-watch.js]
[browser_dbg-fission-switch-target.js]
skip-if = true # Landed disabled for intermittent issues on navigation. See Bug 1605743.
[browser_dbg-go-to-line.js]
[browser_dbg-highlights-calls.js]
[browser_dbg-html-breakpoints.js]

View File

@ -72,6 +72,9 @@ class LegacyServiceWorkersWatcher extends LegacyWorkersWatcher {
// Override from LegacyWorkersWatcher.
async listen() {
// Listen to the current target front.
this.target = this.targetList.targetFront;
this._workersListener.addListener(this._onRegistrationListChanged);
// Fetch the registrations before calling listen, since service workers

View File

@ -19,7 +19,6 @@ class LegacyWorkersWatcher {
constructor(targetList, onTargetAvailable, onTargetDestroyed) {
this.targetList = targetList;
this.rootFront = targetList.rootFront;
this.target = targetList.targetFront;
this.onTargetAvailable = onTargetAvailable;
this.onTargetDestroyed = onTargetDestroyed;
@ -131,6 +130,9 @@ class LegacyWorkersWatcher {
}
async listen() {
// Listen to the current target front.
this.target = this.targetList.targetFront;
if (this.target.isParentProcess) {
await this.targetList.watchTargets(
[TargetList.TYPES.PROCESS],