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

Side by Side Diff: base/test/test_support_android.cc

Issue 12286020: Replace FilePath with base::FilePath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « base/test/test_suite.cc ('k') | chrome/browser/extensions/activity_database_unittest.cc » ('j') | 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 <stdarg.h> 5 #include <stdarg.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "base/android/path_utils.h" 8 #include "base/android/path_utils.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 protected: 133 protected:
134 virtual ~MessagePumpForUIStub() {} 134 virtual ~MessagePumpForUIStub() {}
135 }; 135 };
136 136
137 base::MessagePump* CreateMessagePumpForUIStub() { 137 base::MessagePump* CreateMessagePumpForUIStub() {
138 return new MessagePumpForUIStub(); 138 return new MessagePumpForUIStub();
139 }; 139 };
140 140
141 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA. 141 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
142 bool GetTestProviderPath(int key, FilePath* result) { 142 bool GetTestProviderPath(int key, base::FilePath* result) {
143 switch (key) { 143 switch (key) {
144 case base::DIR_MODULE: { 144 case base::DIR_MODULE: {
145 return base::android::GetExternalStorageDirectory(result); 145 return base::android::GetExternalStorageDirectory(result);
146 } 146 }
147 case base::DIR_ANDROID_APP_DATA: { 147 case base::DIR_ANDROID_APP_DATA: {
148 // For tests, app data is put in external storage. 148 // For tests, app data is put in external storage.
149 return base::android::GetExternalStorageDirectory(result); 149 return base::android::GetExternalStorageDirectory(result);
150 } 150 }
151 default: 151 default:
152 return false; 152 return false;
153 } 153 }
154 } 154 }
155 155
156 void InitPathProvider(int key) { 156 void InitPathProvider(int key) {
157 FilePath path; 157 base::FilePath path;
158 // If failed to override the key, that means the way has not been registered. 158 // If failed to override the key, that means the way has not been registered.
159 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path)) 159 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path))
160 PathService::RegisterProvider(&GetTestProviderPath, key, key + 1); 160 PathService::RegisterProvider(&GetTestProviderPath, key, key + 1);
161 } 161 }
162 162
163 } // namespace 163 } // namespace
164 164
165 namespace base { 165 namespace base {
166 166
167 void InitAndroidTestLogging() { 167 void InitAndroidTestLogging() {
(...skipping 18 matching lines...) Expand all
186 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) 186 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub))
187 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; 187 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override.";
188 } 188 }
189 189
190 void InitAndroidTest() { 190 void InitAndroidTest() {
191 InitAndroidTestLogging(); 191 InitAndroidTestLogging();
192 InitAndroidTestPaths(); 192 InitAndroidTestPaths();
193 InitAndroidTestMessageLoop(); 193 InitAndroidTestMessageLoop();
194 } 194 }
195 } // namespace base 195 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_suite.cc ('k') | chrome/browser/extensions/activity_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698