Bug 1508851 - fix for nsIMsgLocalMailFolder unit test. r=mkmelin
authorBen Campbell <benc@thunderbird.net>
Wed, 21 Nov 2018 12:06:51 +1300
changeset 33836 0e9bf22a6b17f5859686fd464e11f4f8a078fdc7
parent 33835 f93acb5a0e1b922f5a5c76e5aeebfbf208bea88b
child 33837 d8d0149c9c8806ff81fcdab3d18cf35f7b30083a
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersmkmelin
bugs1508851
Bug 1508851 - fix for nsIMsgLocalMailFolder unit test. r=mkmelin One of the tests was calling an nsIMSgLocalMailFolder method on what _should_ have been an nsIMsgFolder object. Also a minor typo fix to reuse a previously-defined variable rather than creating a new one.
mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
--- a/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
+++ b/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
@@ -259,18 +259,19 @@ function test_store_rename(root) {
   folder2 = folder1.getChildNamed("newfolder1-sub");
 
   Assert.ok(folder1.containsChildNamed(folder2.name));
   Assert.ok(folder2.filePath.exists());
 
   folder3 = root.getChildNamed("newfolder3");
   root.propagateDelete(folder3, true, null);
   Assert.ok(!root.containsChildNamed("newfolder3"));
-  folder3 = root.createLocalSubfolder("newfolder3");
-  folder3SubFolder = folder3.createLocalSubfolder("newfolder3-sub");
+  folder3 = root.createLocalSubfolder("newfolder3")
+                .QueryInterface(Ci.nsIMsgLocalMailFolder);
+  folder3Subfolder = folder3.createLocalSubfolder("newfolder3-sub");
   folder3.rename("folder3", null);
 
   Assert.ok(root.containsChildNamed("folder3"));
   Assert.ok(!root.containsChildNamed("newfolder3"));
 }
 
 var gPluggableStores = [
   "@mozilla.org/msgstore/berkeleystore;1",