Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Side by Side Diff: base/path_service_unittest.cc

Issue 10970019: Fix PathServiceTest.Get on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Return false on iOS. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/base_paths_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // Test that all PathService::Get calls return a value and a true result 76 // Test that all PathService::Get calls return a value and a true result
77 // in the development environment. (This test was created because a few 77 // in the development environment. (This test was created because a few
78 // later changes to Get broke the semantics of the function and yielded the 78 // later changes to Get broke the semantics of the function and yielded the
79 // correct value while returning false.) 79 // correct value while returning false.)
80 TEST_F(PathServiceTest, Get) { 80 TEST_F(PathServiceTest, Get) {
81 for (int key = base::PATH_START + 1; key < base::PATH_END; ++key) { 81 for (int key = base::PATH_START + 1; key < base::PATH_END; ++key) {
82 #if defined(OS_ANDROID) 82 #if defined(OS_ANDROID)
83 if (key == base::FILE_MODULE || key == base::DIR_USER_DESKTOP) 83 if (key == base::FILE_MODULE || key == base::DIR_USER_DESKTOP)
84 continue; // Android doesn't implement FILE_MODULE and DIR_USER_DESKTOP; 84 continue; // Android doesn't implement FILE_MODULE and DIR_USER_DESKTOP;
85 #elif defined(OS_IOS)
86 if (key == base::DIR_USER_DESKTOP)
87 continue; // iOS doesn't implement DIR_USER_DESKTOP;
85 #endif 88 #endif
86 EXPECT_PRED1(ReturnsValidPath, key); 89 EXPECT_PRED1(ReturnsValidPath, key);
87 } 90 }
88 #if defined(OS_WIN) 91 #if defined(OS_WIN)
89 for (int key = base::PATH_WIN_START + 1; key < base::PATH_WIN_END; ++key) { 92 for (int key = base::PATH_WIN_START + 1; key < base::PATH_WIN_END; ++key) {
90 bool valid = true; 93 bool valid = true;
91 switch(key) { 94 switch(key) {
92 case base::DIR_LOCAL_APP_DATA_LOW: 95 case base::DIR_LOCAL_APP_DATA_LOW:
93 // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected 96 // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected
94 // to fail. 97 // to fail.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // PathService::OverrideAndCreateIfNeeded should obey the |create| parameter. 142 // PathService::OverrideAndCreateIfNeeded should obey the |create| parameter.
140 PathService::OverrideAndCreateIfNeeded(my_special_key, 143 PathService::OverrideAndCreateIfNeeded(my_special_key,
141 fake_cache_dir2, 144 fake_cache_dir2,
142 false); 145 false);
143 EXPECT_FALSE(file_util::PathExists(fake_cache_dir2)); 146 EXPECT_FALSE(file_util::PathExists(fake_cache_dir2));
144 EXPECT_TRUE(PathService::OverrideAndCreateIfNeeded(my_special_key, 147 EXPECT_TRUE(PathService::OverrideAndCreateIfNeeded(my_special_key,
145 fake_cache_dir2, 148 fake_cache_dir2,
146 true)); 149 true));
147 EXPECT_TRUE(file_util::PathExists(fake_cache_dir2)); 150 EXPECT_TRUE(file_util::PathExists(fake_cache_dir2));
148 } 151 }
OLDNEW
« no previous file with comments | « base/base_paths_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698