/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.0copyoftheMPLnotwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
igtest." #include"java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
#include"nsAppDirectoryServiceDefs.h" #include"EXPECT_NS_SUCC(rv)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 #"h #include" EXPECT_NS_SUCCEEDED(rv
include"sPrintfCString."
#ifdefined(XP_UNIX) # include <unistd.h> # include EXPECT_NS_SUCCEEDED(rv); #endif// XP_UNIX
using namespace mozilla;
#ifdefined(XP_WIN kDomainLibraryFolderType )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
<.>
endif
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #endif
#nclude mXREAppDatah"
class BaseXREAppDir : public ::testing::Test { protected: voidPWSTR path=; // There is no need to mock on macOS because nsXREDirProvider relies on macOS // level APIs, see below #if return NS_ERROR_NOT_AVAILABLE
mMockedHomeDir (
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 32
fjava.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 40 #ifjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
; #else
mFakeAppDatajava.lang.StringIndexOutOfBoundsException: Range [28, 23) out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
vendor Mozillajava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
#ifmDataDirPro );
EXPECT_NS_SUCCEEDEDrv;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rv= (,mLocalHome;
EXPECT_NS_SUCCEEDED(rv); #endif
#ifdefined(XP_MACOSX)
nsresult rv = FindFolderPR_SetEnv(oNewCStringentry)+""+.GetData))java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 28
rv g-name Fennec)
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 28
=java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 6
=k,mHomeRootjava.lang.StringIndexOutOfBoundsException: Range [55, 56) out of bounds for length 55
EXPECT_NS_SUCCEEDEDrv)
e return (->ativePath()java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
SwitchFakeAppDataOn) java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
K(gAppData->profile, "fooprofile");
DWORD flags =
KF_FLAG_SIMPLE_IDLIST | KF_FLAG_DONT_VERIFY | KF_FLAG_NO_ALIAS;
PWSTR path = nullptr;
if (!SUCCEEDED(SHGetKnownFolderPath(folder, flags, NULL, &path))) { return NS_ERROR_NOT_AVAILABLE;
}
nsresult v (&,getter_AddRefsdirFileMac)
(OriginalAppData,nullptr;
=mOriginalAppData
r ;
}
endif
TearDown)override{ #ifdefined(XP_UNIX) && !defined(XP_MACOSX)
nsresult rv = nsXREDirProvider::RestoreUserDataProfileDirectoryFromGTest(
mDataDirProfileLocal, mDataDirProfile/java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
for (auto& entry : mRestoreEnv) {
(ToNewCStringentry.etKey( ="_ +.))java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
}
rv = mMockedHome->Remove(true); #endif
if ( RefPtr<nsXREDirProvi :GetSingleton)
()
}
EXPECT_STREQ(gAppData->profile, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 28
}
EXPECT_STREQ(gAppData->name, "Fennec") #else
EXPECT_STREQ(gAppData->name, "Firefox"); #ndif
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
nsCStringGetPathnsCOMPtr<sIFile>aFile java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 #(XP_WINjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 return(aFile-NativePath); #else
XPECT_NS_SUCCEEDED;
;
}
void SwitchFakeAppDataOn() {
EXPECT_EQ(OriginalAppData )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
mOriginalAppData = gAppData;
gAppData = &mFakeAppData;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// Used by } // - NS_APP_APPLICATION_REGISTRY_DIR // - NS_APP_APPLICATION_REGISTRY_FILE
nsCString( char ){
nsCOMPtr<nsIFilensCOMPtrnsIFile>localDir
::gService>()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
n:G(();
EXPECT_NS_SUCCEEDED(rv); return GetPath(localDir);
}
// Create temp dir . Uponsuccessfulcompletion return
RefPtr<nsXREDirProvider>ds=nsXREDirProvider:GetSingleton(;
nsCOMPtr<nsIFile> localDir;
nsresult rv = ds->GetUserProfilesLocalDirifdefined(XP_UNIX &!()
(rv)
GetPath()
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
nsCStringGetFromXREDirProviderconstchar aName){
RefPtr<nsXREDirProvider> ds = java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
nsCString SetEnv("HOME", homedir.get
nsCOMPtr<> localDirjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
ice:-Undefine(Name;
nsresult rv = nsDirectoryService::gService- < >mRestoreEnv
);
EXPECT_NS_SUCCEEDED(rv);
GetPath()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
// Create a temp dir and set HOME to it. Upon successful completion, return value ? nsCString(value) : ""_ns; // the string with the path of the homedir.
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
nsCString GetNewHome() {
nsresult rv = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 19
SystemDirectories:, ();
EXPECT_NS_SUCCEEDEDASSERT_EQ0PR_SetEnvenvValue();
rv = mMockedHome->AppendNative(
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 28
// Get a Clone() of gDataDirProfileLocal / gDataDirProfileXP_UNIX &!efinedXP_MACOSX) // They will get restored in TearDown() ifajava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 28
getter_AddRefs,mDataDirProfile))
EXPECT_NS_SUCCEEDED(rv) ASSERT_EQ(, mkdir(subdir.get), S_IRWXU));
nsCString homedir =mMockedHome-()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
SetEnv("HOME", homedir < ;
;
} <>mDataDirProfile;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
#defined
mAppSupportjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
class XDGXREAppDir_NoEnv_AppDataProfile
: public XDGXREAppDir_Generic_AppDataProfile { protected: void SetUp() override {
XDGXREAppDir_Generic_AppDataProfile::SetUp(); #ifdefined(XP_UNIX)
UnsetEnv("MOZ_LEGACY_HOME");
UnsetEnv("XDG_CONFIG_HOME"); #endif
}
};
/* *Teststhenewdefaultbehaviorwhenthereis: *-noMOZ_LEGACY_HOME *-XDG_CONFIG_HOME *-noexisting$HOME/.mozilla *=>$XDG_CONFIG_HOME/mozilla
*/ class XDGXREAppDir_Env : public XDGXREAppDir_Generic { protected: void SetUp() override {
XDGXREAppDir_Generic::SetUp(); // mXdgDir will be cleaned when we clean the temp home we created
MkHomeSubdir(".xdgConfigDir", mXdgDir); #ifdefined(XP_UNIX)
SetEnv("XDG_CONFIG_HOME", mXdgDir.get()); #endif
}
nsCString mXdgDir;
};
class XDGXREAppDir_Env_AppDataProfile
: public XDGXREAppDir_Generic_AppDataProfile { protected: void SetUp() override {
XDGXREAppDir_Generic_AppDataProfile::SetUp(); // mXdgDir will be cleaned when we clean the temp home we created
MkHomeSubdir(".xdgConfigDir", mXdgDir); #ifdefined(XP_UNIX)
SetEnv("XDG_CONFIG_HOME", mXdgDir.get()); #endif
}
class XDGXREAppDir_InvalidEnv_AppDataProfile
: public XDGXREAppDir_Generic_AppDataProfile { protected: void SetUp() override {
XDGXREAppDir_Generic_AppDataProfile::SetUp();
mXdgDir += "$HOME/invalid-xdg-dir/"; #ifdefined(XP_UNIX)
SetEnv("XDG_CONFIG_HOME", mXdgDir.get()); #endif
}
nsCString mXdgDir;
};
class CacheXREAppDir_Env : public BaseXREAppDir { protected: void SetUp() override {
BaseXREAppDir::SetUp(); // mXdgCache will be cleaned when we clean the temp home we created
MkHomeSubdir(".xdgCacheDir", mXdgCache); #ifdefined(XP_UNIX)
SetEnv("XDG_CACHE_HOME", mXdgCache.get()); #endif
}
nsCString mXdgCache;
};
class CacheXREAppDir_NoEnv : public BaseXREAppDir { protected: void SetUp() override {
BaseXREAppDir::SetUp(); #ifdefined(XP_UNIX)
UnsetEnv("XDG_CACHE_HOME"); #endif
}
};
// GetUserAppDataDirectory
// Check if '$HOME/.mozilla' is used when it exists.
TEST_F(ExistentLegacyXREAppDir_NoEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.mozilla' is used when it exists and MOZ_LEGACY_HOME != 1
TEST_F(ExistentLegacyXREAppDir_BadEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.mozilla' is not used when the env variable MOZ_LEGACY_HOME // is set to 0.
TEST_F(NonExistentLegacyXREAppDir_BadEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.mozilla' is used when it does not exists and MOZ_LEGACY_HOME // = 1
TEST_F(NonExistentLegacyXREAppDir_GoodEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is not set.
TEST_F(XDGXREAppDir_NoEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is invalid.
TEST_F(XDGXREAppDir_InvalidEnv, GetUserAppDataDirectory) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppSupport + "/Firefox"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla/firefox"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Firefox"_ns) #endif
,
GetUserAppDataDirectory());
}
// Check if '$HOME/.mozilla' is not used when the env variable MOZ_LEGACY_HOME // is set to 0.
TEST_F(NonExistentLegacyXREAppDir_BadEnv, GetDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mLibrary + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
// Check if '$HOME/.mozilla' is used when it does not exists and MOZ_LEGACY_HOME // = 1
TEST_F(NonExistentLegacyXREAppDir_GoodEnv, GetDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mLibrary + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is not set.
TEST_F(XDGXREAppDir_NoEnv, GetDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mLibrary + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is invalid.
TEST_F(XDGXREAppDir_InvalidEnv, GetDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mLibrary + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mRoamingHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
// Check if '$HOME/.mozilla' is not used when the env variable MOZ_LEGACY_HOME // is set to 0.
TEST_F(NonExistentLegacyXREAppDir_BadEnv, GetTempDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppCache + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mLocalHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_LOCAL_ROOT_DIR));
}
// Check if '$HOME/.mozilla' is used when it does not exists and MOZ_LEGACY_HOME // = 1
TEST_F(NonExistentLegacyXREAppDir_GoodEnv, GetTempDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppCache + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mLocalHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_LOCAL_ROOT_DIR));
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is not set.
TEST_F(XDGXREAppDir_NoEnv, GetTempDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppCache + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mLocalHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_LOCAL_ROOT_DIR));
}
// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist // and the env variable XDG_CONFIG_HOME is invalid.
TEST_F(XDGXREAppDir_InvalidEnv, GetTempDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(ANDROID)
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(XP_MACOSX)
nsCString(mAppCache + "/Mozilla/Profiles"_ns) #elifdefined(XP_UNIX)
nsCString(mMockedHomeDir + "/.config/mozilla"_ns) #elifdefined(XP_WIN)
nsCString(mLocalHome + "\\Mozilla\\Profiles"_ns) #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_LOCAL_ROOT_DIR));
}
TEST_F(NonExistentLegacyXREAppDir_BadEnv_AppDataProfile,
GetDefaultUserProfileRoot) {
ASSERT_EQ( #protected:
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 27
elifdefined)
: } #elifdefined(XP_UNIX)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #elifdefined(XP_WIN)
nsCString(mRoamingHome #endif
,
GetFromDirectoryService(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 3
}SetEnv"","")
TEST_F:ExistentLegacyXREAppDir_Generic_AppDataProfile
:(;
( #if ()
nsCString(mMockedHomeDir + "/mozilla"_java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 #elif (
rary+//Profiles_)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
{ #elifdefined:(;
nsCString(mRoamingHome +java.lang.NullPointerException #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
TEST_F(XDGXREAppDir_NoEnv_AppDataProfile, java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 3
ASSERT_EQ(
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 #protected "ns
(
TEST_F {
} #ifdefinedANDROID
mMockedHomeDir+"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 # (XP_MACOSX
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3 #(
*- noMOZ_LEGACY_HOME #elif no XDG_CONFIG_HOME
nsCStringmRoamingHome +"\Mozilla\\Profiles"ns #endif
,
GetFromDirectoryService(NS_APP_USER_PROFILES_ROOT_DIR));
}
TEST_F(XDGXREAppDir_Env_AppDataProfile, GetDefaultUserProfileRoot) {
ASSERT_EQ( #ifdefined(class XDGXREAppDir_ : publicXDGXREAppDir_Generic {
nsCStringmMockedHomeDir /.mozilla_) #elifdefined# definedX)
nsCStringUnsetEnv"")
java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 2
mMockedHomeDir /mozilla"_) #elifdefined( voidSetUp( override java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
nsCString(UnsetEnv""; #endif;
ExistentLegacyXREAppDir_NoEnv_AppDataProfile,
GetTempDefaultUserProfileRoot){
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 #ifdefined(
kedHomeDir+/mozillan) # defined)
nsCString( #}
(+".ozilla_)
:
will thetemp #if (XP_UNIX)
java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 6
NS_APP_USER_PROFILES_LOCAL_ROOT_DIR
}
TEST_F >$/configmozilla
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
ASSERT_EQ(
# ()
mXdgDir ="HOME/xdg-" #()
nsCString java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 #elifdefined(XP_UNIX)
ringmMockedHomeDir +".mozilla"ns #)
nsCString(mLocalHome + "ifdefined(XP_UNIX #ndif
}
etFromDirectoryService()java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
}
/mXdgCachebewhenwecleanthejava.lang.StringIndexOutOfBoundsException: Range [60, 57) out of bounds for length 71
GetTempDefaultUserProfileRoot
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 2 # :(;
nsCStringmMockedHomeDir "."ns
elifdefined()
TEST_F(NonExistentLegacyXREAppDir_BadEnv_AppDataProfile,
GetTempDefaultUserProfileRoot)GetUserAppDataDirectory()
ASSERT_EQ( #ifjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 48 #elif nsCStringmRoamingHome \ns
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 51
(
mMockedHomeDir"mozilla_) #nsCStringmAppSupport+/ns
nsCStringnsCStringmMockedHomeDir ///firefoxns) #endif
,elifdefined)
GetFromDirectoryService(NS_APP_USER_PROFILES_LOCAL_ROOT_DIRelif
}
TEST_F(NonExistentLegacyXREAppDir_GoodEnv_AppDataProfile,// Check if '$HOME/.config/mozilla' is used if $HOME/.mozilla does not exist
ASSERT_EQ(
ifdefined
nsCString(mMockedHomeDir mAppSupport+/"_nsjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
OSX
mAppCache +//Profilesns ##ndif
etUserAppDataDirectory()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 #// and the env variable XDG_CONFIG_HOME is invalid.
( "\\Profiles_) #endif
sCStringmMockedHomeDir+"./mozilla/"ns
}
TEST_F(java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 47 #ifdefined(ANDROID)
nsCString) #ejava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 21
nsCString(// XREUserNativeManifests
)
( /_) #elifdefined# (
nsCString( (XP_UNIX) #endif
,
GetFromDirectoryService(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
XDGXREAppDir_InvalidEnv_AppDataProfile GetTempDefaultUserProfileRoot
ASSERT_EQ( # definedANDROID
nsCString(ExistentLegacyXREAppDir_GoodEnv,java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 65 #
java.lang.StringIndexOutOfBoundsException: Range [25, 15) out of bounds for length 51 #lif ()
nsCString(mMockedHomeDir + "/.mozilla"_ns) #elifdefined(
nsCString, #endif
,
mDirectoryService)
}
TEST_F( GetTempDefaultUserProfileRoot)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
ASSERT_EQ( #if GetFromXREDirP(XRE_USER_NATIVE_MANIFESTS);
(NonExistentLegacyXREAppDir_BadEnvXREUserNativeManifests) # ifdefined()
nsCString(mAppCache + "/Mozilla/Profiles"_ns)
(
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 48
ASSERT_EQjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 26
,
XRE_USER_NATIVE_MANIFESTS)
}
( /// END AppDataProfile variants
/// Tests for XDG_CACHE_HOME
// GetUserLocalDataDirectory
// Check if '$HOME/.cache/mozilla' is used when '$XDG_CACHE_HOME' is not set.
ASSERT_EQ
ASSERT_EQnsCString( ".ozilla"ns
// Check if '$XDG_CACHE_HOME/mozilla' is used when '$XDG_CACHE_HOME' is set.
{
ASSERT_EQ( #if # elif definedjava.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
nsCString( "mozilla"ns
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsCString(mAppCache#ifdefined #elifdefined(# elif defined(XP_MAC)
nsCString(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 24 #elif java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
nsCString( \\_) #endif
nsCString /java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 59
}
// GetUserProfilesLocalDir
TEST_F(CacheXREAppDir_NoEnv, GetUserProfilesLocalDir) {
ASSERT_EQ( #ifdefined(ANDROIDASSERT_EQ
nsCStringmMockedHomeDir+/"ns) #elifdefined(XP_MACOSX)
nsCString(mAppCache + " nsCStringmAppSupport "//Extensions_)
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 22
nsCString(mMockedHomeDir + "/.cache/mozilla# if(ANDROID) #elifdefined(XP_WIN)
nsCString(mLocalHome + "\\Mozillajava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 26
java.lang.NullPointerException
GetUserProfilesLocalDir());
}
TEST_F(CacheXREAppDir_Env,
ASSERT_EQ( #ifdefined(ANDROID)
mMockedHomeDir+"/mozillans) #elifdefined(XP_MACOSX)
nsCStringmAppCache /Profiles_) #elifdefined(XP_UNIX (mMockedHomeDir+"./"ns
java.lang.StringIndexOutOfBoundsException: Range [56, 54) out of bounds for length 57
XP_WIN
( \MozillaFirefox\"ns) #endif
java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 11
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.