Fix XPCShell password authentication tests so that they don't pass around fake docShells

RESOLVED FIXED in Thunderbird 16.0

Status

Thunderbird
Testing Infrastructure
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mconley, Assigned: standard8)

Tracking

(Blocks: 1 bug, {intermittent-failure})

Trunk
Thunderbird 16.0
x86
All
intermittent-failure
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Bug 669603 introduced a change that makes it impossible for us to mock docShells with JavaScript for our XPCShell tests.

We need to alter our authentication and testing infrastructure so that passing around fake docShells is no longer required.
Duplicate of this bug: 771226
Duplicate of this bug: 771229
Duplicate of this bug: 771230
(Assignee)

Comment 4

5 years ago
Created attachment 639433 [details] [diff] [review]
The fix

This patch creates a function on nsIMsgWindow that will return the auth prompt.  This gives us the opportunity in xpcshell tests to not need to fake the docShell.

It also gives us a bit of a clearer function to call when we do really want the auth prompt.
(Assignee)

Comment 5

5 years ago
Created attachment 639436 [details] [diff] [review]
The fix v2

Now without commented out sections.
Attachment #639433 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
Comment on attachment 639436 [details] [diff] [review]
The fix v2

Passes unit tests locally and still seems to work for the prompting users normally.
Attachment #639436 - Flags: superreview?(dbienvenu)
Attachment #639436 - Flags: review?(mconley)
Comment on attachment 639436 [details] [diff] [review]
The fix v2

This doesn't look like the right patch to me...
Attachment #639436 - Flags: review?(mconley) → review-
(Assignee)

Comment 8

5 years ago
Created attachment 639447 [details] [diff] [review]
The fix v2
Attachment #639436 - Attachment is obsolete: true
Attachment #639436 - Flags: superreview?(dbienvenu)
Attachment #639447 - Flags: superreview?(dbienvenu)
Attachment #639447 - Flags: review?(mconley)

Comment 9

5 years ago
looks reasonable, but it'll take me a while to rebuild and test...

Comment 10

5 years ago
Comment on attachment 639447 [details] [diff] [review]
The fix v2

sr=me, based on running the mailnews/local tests, and verifying that imap password prompting still works.
Attachment #639447 - Flags: superreview?(dbienvenu) → superreview+
(Assignee)

Comment 11

5 years ago
I checked this in early pending Mike's review so that we could get the tree green again:

https://hg.mozilla.org/comm-central/rev/e61aeddc94ef
Comment on attachment 639447 [details] [diff] [review]
The fix v2

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

This looks good, everything seems to function normally, and I can't really argue with the results on tbpl.

Just two little nits, perhaps worthy of a followup patch.

Great job!

-Mike

::: mailnews/base/public/nsIMsgWindow.idl
@@ +45,5 @@
>     */
>    readonly attribute nsIDocShell messageWindowDocShell;
> +
> +    /**
> +     * Returns the auth prompt associtated with the window. This will only return

Nits:

This block is incorrectly indented, and there's a typo: "associtated" -> "associated".
Attachment #639447 - Flags: review?(mconley) → review+
(Assignee)

Comment 13

5 years ago
I eventually got around to pushing the comment-only nits:

https://hg.mozilla.org/comm-central/rev/c1a5b1b4af57
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
Keywords: intermittent-failure
Whiteboard: [tb-orange]
You need to log in before you can comment on or make changes to this bug.