Bug 766269 - Thunderbird Permanent orange: TEST_UNEXPECTED_FAIL | test_0030_general.js. Correctly handle MOZ_APP_BASENAME and MOZ_APP_VENDOR being unset when determining the update location for unit tests on Windows. r=ehsan, test-only
This commit is contained in:
@@ -2032,18 +2032,27 @@ XPCShellDirProvider::GetFile(const char *prop, bool *persistent,
|
||||
FAILED(SHGetPathFromIDListA(pItemIDList, appData))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef MOZ_APP_PROFILE
|
||||
sprintf(path, "%s\\%s", appData, MOZ_APP_PROFILE);
|
||||
#else
|
||||
sprintf(path, "%s\\%s\\%s\\%s", appData, MOZ_APP_VENDOR, MOZ_APP_BASENAME, MOZ_APP_NAME);
|
||||
#endif
|
||||
nsAutoString pathName;
|
||||
pathName.AssignASCII(path);
|
||||
pathName.AssignASCII(appData);
|
||||
nsCOMPtr<nsIFile> localFile;
|
||||
nsresult rv = NS_NewLocalFile(pathName, true, getter_AddRefs(localFile));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef MOZ_APP_PROFILE
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_PROFILE));
|
||||
#else
|
||||
// MOZ_APP_VENDOR and MOZ_APP_BASENAME are optional.
|
||||
#ifdef MOZ_APP_VENDOR
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_VENDOR));
|
||||
#endif
|
||||
#ifdef MOZ_APP_BASENAME
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_BASENAME));
|
||||
#endif
|
||||
// However app name is always appended.
|
||||
localFile->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME));
|
||||
#endif
|
||||
return localFile->Clone(result);
|
||||
#else
|
||||
// Fail on non-Windows platforms, the caller is supposed to fal back on
|
||||
|
||||
Reference in New Issue
Block a user