Closed Bug 900519 Opened 11 years ago Closed 11 years ago

Make fakeserver into JS modules

Categories

(MailNews Core :: Testing Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 25.0

People

(Reporter: jcranmer, Assigned: jcranmer)

Details

Attachments

(6 files)

      No description provided.
A lot of people unfortunately rely on gThreadManager being exported. But since Services.tm now exists, I'm opting to move to that instead locally and hopefully global once we have a less-broken tree.

I haven't fully tested this patch, but this [and the next one] is able to pass all of the NNTP tests that work, it looks like.
Attachment #784402 - Flags: review?(mbanner)
The only other test that appears to move easily. IMAP, POP, and SMTP all have a funky relation with authd, and authd and IMAP depend on mailTestUtils.js I believe.
Attachment #784405 - Flags: review?(mbanner)
I'm able to load imap and pop without mailTestUtils, although we might not use the full set of functionality.  Specifically, our sandbox-creating code lives here: https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/test-runner/chrome/content/fake-server-support.js

The loading code is:
  loadInSandbox(baseFakeserver, ['subscript', 'maild.js'], imapSandbox);
  loadInSandbox(baseFakeserver, ['subscript', 'auth.js'], imapSandbox);
  loadInSandbox(baseFakeserver, ['subscript', 'imapd.js'], imapSandbox);
  loadInSandbox(baseFakeserver, ['subscript', 'smtpd.js'], imapSandbox);

The sandbox gets bootstrapped with Components, atob, btoa, TextEncoder, and TextDecoder.

It would be great if the logging could move over to log4moz at some point too.  The always-on dump statements aren't a favorite.
mailTestUtils gives us atob and btoa which are now pretty much present everywhere in all JS contexts (fakeserver predates those days). I think I might have some more dependencies in the IMAP fake server, but that is several thousand lines of code I don't wish to check right now.

I'll try to upload everybody but imapd.js later today.
Attachment #784534 - Flags: review?(mbanner)
Comment on attachment 784402 [details] [diff] [review]
Part 1: Move maild.js

There's a bit of bitrot (unfortunately I lost the patch update), but this looks fine to me. r=Standard8
Attachment #784402 - Flags: review?(mbanner) → review+
Attachment #784405 - Flags: review?(mbanner) → review+
Attachment #784534 - Flags: review?(mbanner) → review+
I've pushed these with bitrot fixed as it cleans up a couple more instances of test failing, and lets me base my next patch on these without more bitrot:

https://hg.mozilla.org/comm-central/rev/931ed23245db
https://hg.mozilla.org/comm-central/rev/8385a25e4632
https://hg.mozilla.org/comm-central/rev/80b93e494946
I haven't rebased these yet, so they'll have contextual bitrot...
Attachment #784962 - Flags: review?(mbanner)
Attached patch part 5: Move popSplinter Review
Attachment #784963 - Flags: review?(mbanner)
Attachment #784965 - Flags: review?(mbanner)
Attachment #784962 - Attachment description: Part 3: Move smtp → Part 4: Move smtp
Comment on attachment 784962 [details] [diff] [review]
Part 4: Move smtp

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

r=me assuming this doesn't break tests.
Attachment #784962 - Flags: review?(mbanner) → review+
Comment on attachment 784963 [details] [diff] [review]
part 5: Move pop

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

r=me assuming this doesn't break tests.
Attachment #784963 - Flags: review?(mbanner) → review+
Comment on attachment 784965 [details] [diff] [review]
Part 6: Move IMAP

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

r=me assuming this doesn't break tests.
Attachment #784965 - Flags: review?(mbanner) → review+
https://hg.mozilla.org/comm-central/rev/c0ec622b7f65
https://hg.mozilla.org/comm-central/rev/3382031f5314
https://hg.mozilla.org/comm-central/rev/d80874664c3f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 25.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: