nsIMsgLocalMailFolder unit tests succeed where they probably shouldn't

RESOLVED FIXED in Thunderbird 65.0

Status

defect
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: benc, Assigned: benc)

Tracking

unspecified
Thunderbird 65.0
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

In mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js (line 267):

  folder3 = root.createLocalSubfolder("newfolder3");
  folder3SubFolder = folder3.createLocalSubfolder("newfolder3-sub");

createLocalSubfolder() is a method on nsIMsgLocalMailFolder, but it returns an nsIMsgFolder, so the second line _should_ fail (ie "ERROR TypeError: folder3.createLocalSubfolder is not a function...").

But it doesn't fail.

`folder3` is previously defined and used at line 244:
  let folder3 = root.createLocalSubfolder("newfolder3")
                    .QueryInterface(Ci.nsIMsgLocalMailFolder);

I _think_ that the second createLocalSubfolder() call at line 267 is failing, but not flagging up an error, and leaving folder3 set to the old value (an nsIMsgLocalFolder).
Which implies that createLocalSubfolder() doesn't work exactly as intended...

This came up as part of work on Bug 453908, when this test _did_ start failing on line 268 (as it always should have!).
My C++ patch in Bug 453908 might fix the createLocalSubfolder() issue (It's at least a step in the right direction).
Oh, to save some typing, here's a cut&paste command line run the test:

  ./mach xpcshell-test comm/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
This patch fixes up the nsIMsgLocalMailFolder unit test.
Doesn't address any potential issue in CreateLocalSubfolder(), but that might be a non-issue depending on how Bug 453908 goes.
Assignee: nobody → benc
Attachment #9026565 - Flags: review?(mkmelin+mozilla)
Blocks: 453908
Comment on attachment 9026565 [details] [diff] [review]
fix_nsimsglocalmailfolder_test.patch

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

Looks good, r=mkmelin
Attachment #9026565 - Flags: review?(mkmelin+mozilla) → review+
Status: NEW → ASSIGNED
Keywords: checkin-needed
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/0e9bf22a6b17
fix for nsIMsgLocalMailFolder unit test. r=mkmelin
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 65.0
You need to log in before you can comment on or make changes to this bug.