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

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

Issue 11031008: Upstreaming chrome/common/chrome_* diff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing Nishel's nits Created 8 years, 2 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/base_paths_android.cc ('k') | chrome/common/chrome_constants.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, FilePath* result) {
143 switch (key) { 143 switch (key) {
144 case base::DIR_MODULE: { 144 case base::DIR_MODULE: {
145 *result = FilePath(base::android::GetExternalStorageDirectory()); 145 return base::android::GetExternalStorageDirectory(result);
146 return true;
147 } 146 }
148 case base::DIR_ANDROID_APP_DATA: { 147 case base::DIR_ANDROID_APP_DATA: {
149 // For tests, app data is put in external storage. 148 // For tests, app data is put in external storage.
150 *result = FilePath(base::android::GetExternalStorageDirectory()); 149 return base::android::GetExternalStorageDirectory(result);
151 return true;
152 } 150 }
153 default: 151 default:
154 return false; 152 return false;
155 } 153 }
156 } 154 }
157 155
158 void InitPathProvider(int key) { 156 void InitPathProvider(int key) {
159 FilePath path; 157 FilePath path;
160 // 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.
161 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path)) 159 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path))
(...skipping 25 matching lines...) Expand all
187 void InitAndroidTestMessageLoop() { 185 void InitAndroidTestMessageLoop() {
188 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub); 186 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub);
189 } 187 }
190 188
191 void InitAndroidTest() { 189 void InitAndroidTest() {
192 InitAndroidTestLogging(); 190 InitAndroidTestLogging();
193 InitAndroidTestPaths(); 191 InitAndroidTestPaths();
194 InitAndroidTestMessageLoop(); 192 InitAndroidTestMessageLoop();
195 } 193 }
196 } // namespace base 194 } // namespace base
OLDNEW
« no previous file with comments | « base/base_paths_android.cc ('k') | chrome/common/chrome_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698