From 938719a1c6063c7a8862a5e243332179bc620dcf Mon Sep 17 00:00:00 2001 From: Viktor P Date: Thu, 12 May 2022 08:12:26 -0700 Subject: [PATCH] fix PathServiceTest.Get test Test was modified according to XBOX limitations b/219026606 Change-Id: Iea811495b50fd29588ba439a955d9522672adb88 --- base/path_service_unittest.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc index 2295441499da..aee989e754cb 100644 --- a/base/path_service_unittest.cc +++ b/base/path_service_unittest.cc @@ -57,7 +57,10 @@ bool ReturnsValidPath(int dir_type) { if (path.ReferencesParent()) return false; #endif - return result && !path.empty() && (!check_path_exists || PathExists(path)); + // Some existing root folders (LocalFolder, LocalCacheFolder, etc.) + // can't be verifyed by PathExists but can do with DirectoryExists + return result && !path.empty() && + (!check_path_exists || PathExists(path) || DirectoryExists(path)); } #if defined(OS_WIN) @@ -85,7 +88,7 @@ TEST_F(PathServiceTest, Get) { for (int key = PATH_START + 1; key < PATH_END; ++key) { #if defined(STARBOARD) if (key == DIR_CURRENT || key == DIR_USER_DESKTOP || - key == DIR_SOURCE_ROOT) { + key == DIR_SOURCE_ROOT || key == DIR_HOME) { continue; } #else