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

RESOLVED FIXED in Thunderbird 16.0

Status

MailNews Core
Testing Infrastructure
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: hiro, Assigned: hiro)

Tracking

Trunk
Thunderbird 16.0
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
Created attachment 634648 [details] [diff] [review]
Fix

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)
(Assignee)

Updated

5 years ago
Blocks: 766467

Comment 2

5 years ago
Comment on attachment 634648 [details] [diff] [review]
Fix

very clever, Hiro, thx for the patch!
Attachment #634648 - Flags: review?(dbienvenu) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/bed20da5f695
Status: ASSIGNED → RESOLVED
Last Resolved: 5 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.