From 6307292d441c0615514b38b7706fb6f46484ea16 Mon Sep 17 00:00:00 2001 From: David Bienvenu Date: Wed, 17 Jun 2009 08:19:16 -0700 Subject: [PATCH] add test for multiple imap folder moves to same target, r=standard8, 496905 --- .../imap/test/unit/test_imapFolderCopy.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mailnews/imap/test/unit/test_imapFolderCopy.js b/mailnews/imap/test/unit/test_imapFolderCopy.js index 53e9a94d9a..f45876c24c 100644 --- a/mailnews/imap/test/unit/test_imapFolderCopy.js +++ b/mailnews/imap/test/unit/test_imapFolderCopy.js @@ -52,6 +52,34 @@ const gTestArray = do_check_neq(folder2, null); do_check_neq(folder3, null); doTest(++gCurTestNum); + }, + function moveImapFolder1() { + let folders = new Array; + let folder1 = gIMAPInbox.getChildNamed("empty 1"); + let folder2 = gIMAPInbox.getChildNamed("empty 2"); + folders.push(folder2.QueryInterface(Ci.nsIMsgFolder)); + let array = toXPCOMArray(folders, Ci.nsIMutableArray); + gCopyService.CopyFolders(array, folder1, true, CopyListener, null); + }, + function moveImapFolder2() { + let folders = new Array; + let folder1 = gIMAPInbox.getChildNamed("empty 1"); + let folder3 = gIMAPInbox.getChildNamed("empty 3"); + folders.push(folder3.QueryInterface(Ci.nsIMsgFolder)); + let array = toXPCOMArray(folders, Ci.nsIMutableArray); + gCopyService.CopyFolders(array, folder1, true, CopyListener, null); + }, + function verifyImapFolders() { + let folder1 = gIMAPInbox.getChildNamed("empty 1"); + dump("found folder1\n"); + let folder2 = folder1.getChildNamed("empty 2"); + dump("found folder2\n"); + let folder3 = folder1.getChildNamed("empty 3"); + dump("found folder3\n"); + do_check_neq(folder1, null); + do_check_neq(folder2, null); + do_check_neq(folder3, null); + doTest(++gCurTestNum); } ];