Closed Bug 1588193 Opened 6 months ago Closed 5 months ago

Fix BrowserTestUtils.waitForContentEvent with Fission

Categories

(Core :: DOM: Content Processes, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla72
Fission Milestone M4
Tracking Status
firefox72 --- fixed

People

(Reporter: kashav, Assigned: kashav)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

Various tests that rely on this helper are disabled. This function can likely be rewritten to just use BrowserTestUtils.addContentEventListener, which is being made Fission-compatible in bug 1586393.

I'll take this for now, though if you want to look at it after I finish bug 1586393 that is okay with me. It does seem like it'll have to be implemented in a very similar way in order to deal with process switches.

Assignee: nobody → continuation
Status: NEW → ASSIGNED
Fission Milestone: --- → M4

This bug will also likely fix BrowserTestUtils.waitForErrorPage, which just calls waitForContentEvent and sometimes waits for a TabRemotenessChange.

This bug will also likely fix the remaining dom/indexedDB tests which can then be enabled by landing https://phabricator.services.mozilla.com/D49753

Blocks: 1591873
No longer blocks: 1591873
Assignee: continuation → kmadan
Priority: P2 → P1

BrowserTestUtils.waitForErrorPage may resolve slightly earlier than it did
before, so we may arrive at an about:neterror page that hasn't been completely
initialized. We should only dispatch the AboutNetErrorLoad event when we're done
making changes to the page.

Various BrowserTestUtils.waitForContentEvent call sites expect to see an event
on a browser element that was open before the call was made. For this reason,
each of the browsers need to also have a ContentEventListener actor.

Depends on D51439

This also changes BrowserTestUtils.addContentEventListener to use browsing
contexts to track added listeners and their associated targets.

Depends on D51440

These tests relied on assumptions that were broken by the new
BrowserTestUtils.waitForContentEvent (timing, ContentTask, etc).

Depends on D51441

Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c90bab12f4cb
Don't dispatch AboutNetErrorLoad until we're completely setup, r=johannh
https://hg.mozilla.org/integration/autoland/rev/b10ec4058ec3
Register the ContentEventListener actor for every browsing context, r=mconley
https://hg.mozilla.org/integration/autoland/rev/074bb8a6fd68
Fix BrowserTestUtils.waitForContentEvent with Fission, r=mccr8
https://hg.mozilla.org/integration/autoland/rev/0bbb1f92bb47
Fix broken tests, r=mccr8

Looks like the failing test was updated yesterday, explains why it didn't fail any of my try pushes. It listens for an AboutBlockedLoaded on the browser, but it's only dispatched to the iframe. I think have a fix.

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=02a6512162fbd7193f72d0dcc986e3a6aed643c1

Flags: needinfo?(kmadan)
Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a0d9537d24c6
Don't dispatch AboutNetErrorLoad until we're completely setup, r=johannh
https://hg.mozilla.org/integration/autoland/rev/1ada54e7ba7c
Register the ContentEventListener actor for every browsing context, r=mconley
https://hg.mozilla.org/integration/autoland/rev/1beab20978b2
Fix BrowserTestUtils.waitForContentEvent with Fission, r=mccr8
https://hg.mozilla.org/integration/autoland/rev/df4c4004abc5
Fix broken tests, r=mccr8

Looks like this test started failing intermittently after bug 1586393, but this patch increases its failure rate. Probably caused by switching from tracking browser elements to browsing contexts.

Flags: needinfo?(kmadan)

These are thrown when the actor no longer has a manager but attempts to access
its docshell or browsing context. We may arrive at this state without seeing
a willDestroy() if the process is being shutdown or the actor was destroyed from
the parent.

Depends on D51440

Pushed by kmadan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/660463ccc32a
Don't dispatch AboutNetErrorLoad until we're completely setup, r=johannh
https://hg.mozilla.org/integration/autoland/rev/8cc74a09b1c6
Register the ContentEventListener actor for every browsing context, r=mconley
https://hg.mozilla.org/integration/autoland/rev/3c4ee65f29c6
Swallow InvalidStateError exceptions caused by docshell retrievals, r=mccr8
https://hg.mozilla.org/integration/autoland/rev/9944bddc7b99
Fix BrowserTestUtils.waitForContentEvent with Fission, r=mccr8
https://hg.mozilla.org/integration/autoland/rev/7c24449d6802
Fix broken tests, r=mccr8
See Also: → 1595183
You need to log in before you can comment on or make changes to this bug.