OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/path_service.h" | 5 #include "base/path_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 29 matching lines...) Expand all Loading... |
40 typedef PlatformTest PathServiceTest; | 40 typedef PlatformTest PathServiceTest; |
41 | 41 |
42 // Test that all PathService::Get calls return a value and a true result | 42 // Test that all PathService::Get calls return a value and a true result |
43 // in the development environment. (This test was created because a few | 43 // in the development environment. (This test was created because a few |
44 // later changes to Get broke the semantics of the function and yielded the | 44 // later changes to Get broke the semantics of the function and yielded the |
45 // correct value while returning false.) | 45 // correct value while returning false.) |
46 TEST_F(PathServiceTest, Get) { | 46 TEST_F(PathServiceTest, Get) { |
47 for (int key = base::DIR_CURRENT; key < base::PATH_END; ++key) { | 47 for (int key = base::DIR_CURRENT; key < base::PATH_END; ++key) { |
48 EXPECT_PRED1(ReturnsValidPath, key); | 48 EXPECT_PRED1(ReturnsValidPath, key); |
49 } | 49 } |
50 #ifdef OS_WIN | 50 #if defined(OS_WIN) |
51 for (int key = base::PATH_WIN_START + 1; key < base::PATH_WIN_END; ++key) { | 51 for (int key = base::PATH_WIN_START + 1; key < base::PATH_WIN_END; ++key) { |
52 if (key == base::DIR_LOCAL_APP_DATA_LOW && | 52 if (key == base::DIR_LOCAL_APP_DATA_LOW && |
53 win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { | 53 win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { |
54 // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected to | 54 // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected to |
55 // fail. | 55 // fail. |
56 EXPECT_TRUE(ReturnsInvalidPath(key)) << key; | 56 EXPECT_TRUE(ReturnsInvalidPath(key)) << key; |
57 } else { | 57 } else { |
58 EXPECT_TRUE(ReturnsValidPath(key)) << key; | 58 EXPECT_TRUE(ReturnsValidPath(key)) << key; |
59 } | 59 } |
60 } | 60 } |
| 61 #elif defined(OS_MACOSX) |
| 62 for (int key = base::PATH_MAC_START + 1; key < base::PATH_MAC_END; ++key) { |
| 63 EXPECT_PRED1(ReturnsValidPath, key); |
| 64 } |
61 #endif | 65 #endif |
62 } | 66 } |
OLD | NEW |