diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 23:59:04 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-07 23:59:04 +0000 |
commit | 0cfda1e2e62c2af07b2c22badb85ee501a14d20e (patch) | |
tree | 8c246ef0a651c207348bd16f844c7da53473c9cf /base/path_service_unittest.cc | |
parent | 0814e98845b27d80fbd9788d408a58c8a29c89a7 (diff) | |
download | chromium_src-0cfda1e2e62c2af07b2c22badb85ee501a14d20e.zip chromium_src-0cfda1e2e62c2af07b2c22badb85ee501a14d20e.tar.gz chromium_src-0cfda1e2e62c2af07b2c22badb85ee501a14d20e.tar.bz2 |
Remove a NOTREACHED() that was causing a dialog box during unit tests, hence
making it timeout on the test bot. Also simplify the test code.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/path_service_unittest.cc')
-rw-r--r-- | base/path_service_unittest.cc | 14 |
1 files changed, 4 insertions, 10 deletions
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 |