Closed Bug 766380 Opened 12 years ago Closed 12 years ago

test_imapHdrChunking.js should use nsIFolderListener instead of nsIMsgFolderListener and nsIStreamListener.

Categories

(MailNews Core :: Testing Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 16.0

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file)

test_imapHdrChunking.js is fragile. 

--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -499,26 +499,27 @@ void nsMessengerUnixIntegration::FillToo
   {
 #ifdef MOZ_THUNDERBIRD
     nsCOMPtr<nsIStringBundle> bundle;
     GetStringBundle(getter_AddRefs(bundle));
 
     if (!bundle)
       return;
 
+#if 0
     // Create the notification title
     nsString alertTitle;
     if (!BuildNotificationTitle(folder, bundle, alertTitle))
       return;
 
     // Let's get the new mail for this folder
     nsCOMPtr<nsIMsgDatabase> db;
     if (NS_FAILED(folderWithNewMail->GetMsgDatabase(getter_AddRefs(db))))
       return;
-
+#endif
     PRUint32 numNewKeys = 0;
     PRUint32 *newMessageKeys;
     db->GetNewList(&numNewKeys, &newMessageKeys);
 
     // If we had new messages, we *should* have new keys, but we'll
     // check just in case.
     if (numNewKeys <= 0) {
       NS_Free(newMessageKeys);

With this change, test_imapHdrChunking.js fails:

TEST-UNEXPECTED-FAIL | /home/zoe/hg/comm-central/objdir-thunderbird/mozilla/_tests/xpcshell/mailnews/imap/test/unit/test_imapHdrChunking.js | 9 == 3 - See following stack:

because receiving onStopRequest is too late, I guess main loop spins twice in this case.

updateFolderWithListener with null argument for nsIMsgWindow make biff notify, so we should use the notify to notice the first chunk receiving.
Attached patch FixSplinter Review
Try server result:
https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=2a0c7d8a6f40

I also confirmed this change works fine on Windows XP.
Assignee: nobody → hiikezoe
Status: NEW → ASSIGNED
Attachment #634648 - Flags: review?(dbienvenu)
Blocks: 766467
Comment on attachment 634648 [details] [diff] [review]
Fix

very clever, Hiro, thx for the patch!
Attachment #634648 - Flags: review?(dbienvenu) → review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/bed20da5f695
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: