Closed Bug 1572781 Opened 5 years ago Closed 5 years ago

Fix XPConnect browser mochitests

Categories

(Core :: XPConnect, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Fission Milestone M4
Tracking Status
firefox70 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

There are two Mochitests in js/xpconnect/tests/browser, which basically work the same way. They open a page, create some references to things in that page, then navigate to a new URL to cause a window destroy on the original page, then check that the references created earlier have been destroyed appropriately.

The navigation they do is this: content.location = "http://example.org/";

If you run these tests with Fission, things go okay for awhile, but eventually the test kind of hangs, with this error: JavaScript error: resource://testing-common/content-task.js, line 66: NS_ERROR_ILLEGAL_VALUE

This is line 66: sendAsyncMessage("content-task:complete", {

Kris figured out that what is happening is that after the cross-process navigation happens, the message manager in the original content process (where this content-task.js script is running) is torn down, and then we hit an error inside message manager code, and NS_ERROR_NULL_POINTER is the same as NS_ERROR_ILLEGAL_VALUE, so we get the confusing error message. I'm sure a bunch of tests will break with that error message, so that's something to keep an eye out for.

This might be tricky if these tests were doing something interesting with the page they navigate to, but the page is really just arbitrary, so changing them to navigate to http://mochi.test:8888/ works.

These tests both load a page, create some chrome reference to it, then
navigate to another page to cause a window close on the original page,
then check to make sure the references to the original page have gone
away.

With Fission, if the navigation is cross-process, then the message
manager gets torn down in the original process where the browser test
is running, and the sendAsyncMessage call in content-task.js fails
with the cryptic error NS_ERROR_ILLEGAL_VALUE.

This can be fixed by making the navigation not be cross-origin. The
test only wants the original pages to be torn down. The origin of the
new page doesn't matter.

Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eb92413f3429
Stop doing cross-origin navigation in XPConnect browser tests. r=kmag
See Also: → 1572872

I filed bug 1572872 about making the message manager error less confusing.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Fission Milestone: --- → M4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: