Closed Bug 1237834 Opened 4 years ago Closed 4 years ago

test_getauthenticationinfo.html pops up login dialog with e10s

Categories

(Core :: Plug-ins, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
e10s + ---
firefox46 --- fixed
firefox47 --- fixed

People

(Reporter: mccr8, Assigned: qdot)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

When run with e10s, this test pops up an authentication dialog. When run without it, it does not.

This is similar to bug 1221320, though there's no XHR here, so it doesn't seem like it could be the exact same thing. It might be an issue with the test plugin. I don't know what is responsible for popping up that authentication dialog.
This might be an actual Gecko bug. I can't really tell.
tracking-e10s: --- → ?
Assignee: nobody → kyle
Ok, this is the only test outside of things in toolkit/components/passwordmgr/test that is using authenticate.sjs. All mochitests in toolkit/components/passwordmgr/test are marked skip for e10s. So I'm guessing this component just doesn't work with e10s. What's the next step here? Any plans to fix the password manager tests also? I didn't see an open bug for that yet...
Flags: needinfo?(continuation)
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #2)
> Ok, this is the only test outside of things in
> toolkit/components/passwordmgr/test that is using authenticate.sjs. All
> mochitests in toolkit/components/passwordmgr/test are marked skip for e10s.
> So I'm guessing this component just doesn't work with e10s. What's the next
> step here? Any plans to fix the password manager tests also? I didn't see an
> open bug for that yet...

In the e10s test spreadsheet, somebody marked all of those tests "Tests are finicky and will likely be involved in getting fixed up" and marked them for Manual QA. So I guess nobody is looking at that. But the sjs is just some fake server written in JS so I'd be a little surprised if it was the .sjs in particular broken in e10s. I haven't actually checked it, though.
Flags: needinfo?(continuation)
There's also browser/base/content/test/general/authenticate.sjs which seems to be a similar file, and it is being used in a bc test browser_thumbnails_bg_no_auth_prompt.js that seems to be running with e10s so you could try that and see if it helps anything.
Ok, authenticate.sjs isn't the issue, browser one does the same thing. Will continue looking.
The problem ended up being in nsIHTTPAuthManager. This is a service that is only used by tests in order to manipulate the auth cache. However, as far as I can tell in DXR, the only e10s test that hits this is test_getauthenticationinfo.html.

This patch is the short, hacky version of the fix. Basically, two auth checks happen. One in the plugin, which queries the content process for auth info, and one in HTTP network stuff, which happens in the parent process, and is what was popping the window, since we weren't adding to the auth cache there. I just added a chrome script to add the auth cache info in the parent process, so both checks are happy.

The actual fix would just be to make HTTPAuthCache an e10s compliant service that only exists on the parent process. That's a followup bug situation, though, as right now I'm just trying to get this un-oranged, and no other tests seem to be exhibiting this issue.
Attachment #8719072 - Flags: review?(continuation)
Comment on attachment 8719072 [details] [diff] [review]
Patch 1 (v1) - Make sure auth ident is set in both parent and child processes

Review of attachment 8719072 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/plugins/test/mochitest/mochitest.ini
@@ +3,4 @@
>  support-files =
>    307-xo-redirect.sjs
>    crashing_subpage.html
> +  file_authident.js

You also need to remove the skip-if for test_getauthenticationinfo.html in this file.

::: dom/plugins/test/mochitest/test_getauthenticationinfo.html
@@ +61,4 @@
>  SimpleTest.waitForExplicitFinish();
>  setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
>  
> +// Authentication info is added twice here. In the non-e10s case, this does

Thanks for the comment.

@@ +61,5 @@
>  SimpleTest.waitForExplicitFinish();
>  setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
>  
> +// Authentication info is added twice here. In the non-e10s case, this does
> +// nothing. In the e10s case, this is because we need it auth info both the

This sentence is a little mangled. "it auth info both" should be "auth info in both" maybe?

@@ +64,5 @@
> +// Authentication info is added twice here. In the non-e10s case, this does
> +// nothing. In the e10s case, this is because we need it auth info both the
> +// child process, that the plugin checks for auth validity, and the parent process,
> +// that the http network objects use.
> +// TODO: Clean this up once HTTPAuthManager is made e10s compliant

Is there a bug on file for this that you could refer to?
Attachment #8719072 - Flags: review?(continuation) → review+
https://hg.mozilla.org/mozilla-central/rev/c197eee3f8b3
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.