diff options
-rw-r--r-- | base/base_paths_win.cc | 2 | ||||
-rw-r--r-- | base/path_service_unittest.cc | 14 |
2 files changed, 4 insertions, 12 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc index fe3e1df..432bc90 100644 --- a/base/base_paths_win.cc +++ b/base/base_paths_win.cc @@ -32,7 +32,6 @@ #include <shlobj.h> #include "base/file_util.h" -#include "base/logging.h" #include "base/path_service.h" #include "base/win_util.h" @@ -109,7 +108,6 @@ bool PathProviderWin(int key, std::wstring* result) { break; case base::DIR_LOCAL_APP_DATA_LOW: if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { - NOTREACHED(); return false; } // TODO(nsylvain): We should use SHGetKnownFolderPath instead. Bug 1281128 diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc index 2835d37..b75ab7e 100644 --- a/base/path_service_unittest.cc +++ b/base/path_service_unittest.cc @@ -46,10 +46,10 @@ bool ReturnsValidPath(int dir_type) { } // Function to test DIR_LOCAL_APP_DATA_LOW on Windows XP. Make sure it fails. -void GetPath() { +bool ReturnsInvalidPath(int dir_type) { std::wstring path; bool result = PathService::Get(base::DIR_LOCAL_APP_DATA_LOW, &path); - EXPECT_FALSE(result); + return !result && path.empty(); } } // namespace @@ -68,15 +68,9 @@ TEST(PathServiceTest, Get) { win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected to // fail. -#ifdef _DEBUG - EXPECT_FATAL_FAILURE(GetPath(), ":FATAL:base_paths_win.cc("); -#else - // In release, the DCHECK won't be hit. Still verify that - // PathService::Get() returns false. - GetPath(); -#endif + EXPECT_TRUE(ReturnsInvalidPath(key)) << key; } else { - EXPECT_PRED1(ReturnsValidPath, key); + EXPECT_TRUE(ReturnsValidPath(key)) << key; } } #endif |