fix bug 562104, crash when subscribed to imap folder '/', r/sr=standard8

This commit is contained in:
David Bienvenu 2010-06-24 07:24:31 -07:00
Родитель f5f18972f3
Коммит f1a9d3be13
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -1057,6 +1057,8 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const nsACString& folder
if (dupFolderPath.Last() == '/')
{
dupFolderPath.SetLength(dupFolderPath.Length()-1);
if (dupFolderPath.IsEmpty())
return NS_ERROR_FAILURE;
// *** this is what we did in 4.x in order to list uw folder only
// mailbox in order to get the \NoSelect flag
explicitlyVerify = !(boxFlags & kNameSpace);
@ -1165,7 +1167,8 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const nsACString& folder
(kPublicMailbox | kOtherUsersMailbox | kPersonalMailbox))), &parentIsNew);
}
}
hostFolder->CreateClientSubfolderInfo(dupFolderPath, hierarchyDelimiter,boxFlags, PR_FALSE);
rv = hostFolder->CreateClientSubfolderInfo(dupFolderPath, hierarchyDelimiter,boxFlags, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
caseInsensitive = MsgLowerCaseEqualsLiteral(dupFolderPath, "inbox");
a_nsIFolder->GetChildWithURI(uri, PR_TRUE, caseInsensitive, getter_AddRefs(child));
}

Просмотреть файл

@ -59,6 +59,16 @@ const gTestArray =
QueryInterface(Ci.nsIMsgImapMailFolder);
newChild.updateFolderWithListener(null, UrlListener);
},
function checkEmptyFolder() {
try {
let serverSink = gLocalServer.QueryInterface(Ci.nsIImapServerSink);
serverSink.possibleImapMailbox("/", '/', 0);
}
catch (ex) {
// we expect this to fail, but not crash or assert.
}
do_timeout_function(0, function(){doTest(++gCurTestNum)});
},
];
function endTest()
@ -80,7 +90,7 @@ function doTest(test)
var testFn = gTestArray[test-1];
// Set a limit of 10 seconds; if the notifications haven't arrived by then there's a problem.
do_timeout(10000, function(){
do_timeout_function(10000, function(){
if (gCurTestNum == test)
do_throw("Notifications not received in 10000 ms for operation " + testFn.name +
", current status is " + gCurrStatus);
@ -113,6 +123,6 @@ var UrlListener =
// This can happen with a bunch of synchronous functions grouped together, and
// can even cause tests to fail because they're still waiting for the listener
// to return
do_timeout(0, function(){doTest(++gCurTestNum)});
do_timeout_function(0, function(){doTest(++gCurTestNum)});
}
};