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

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

Issue 1926793002: 👔 Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cast compile Created 4 years, 7 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
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/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 std::unique_ptr<base::MessagePump> CreateMessagePumpForUIStub() { 130 std::unique_ptr<base::MessagePump> CreateMessagePumpForUIStub() {
131 return std::unique_ptr<base::MessagePump>(new MessagePumpForUIStub()); 131 return std::unique_ptr<base::MessagePump>(new MessagePumpForUIStub());
132 }; 132 };
133 133
134 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA. 134 // Provides the test path for DIR_MODULE and DIR_ANDROID_APP_DATA.
135 bool GetTestProviderPath(int key, base::FilePath* result) { 135 bool GetTestProviderPath(int key, base::FilePath* result) {
136 switch (key) { 136 switch (key) {
137 case base::DIR_ANDROID_APP_DATA: { 137 case base::DIR_ANDROID_APP_DATA: {
138 // For tests, app data is put in external storage. 138 // For tests, app data is put in external storage.
139 return base::android::GetExternalStorageDirectory(result); 139 return PathService::Get(base::DIR_SOURCE_ROOT, result);
140 } 140 }
141 default: 141 default:
142 return false; 142 return false;
143 } 143 }
144 } 144 }
145 145
146 void InitPathProvider(int key) { 146 void InitPathProvider(int key) {
147 base::FilePath path; 147 base::FilePath path;
148 // If failed to override the key, that means the way has not been registered. 148 // If failed to override the key, that means the way has not been registered.
149 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path)) 149 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path))
(...skipping 24 matching lines...) Expand all
174 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) 174 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub))
175 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; 175 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override.";
176 } 176 }
177 177
178 void InitAndroidTest() { 178 void InitAndroidTest() {
179 InitAndroidTestLogging(); 179 InitAndroidTestLogging();
180 InitAndroidTestPaths(); 180 InitAndroidTestPaths();
181 InitAndroidTestMessageLoop(); 181 InitAndroidTestMessageLoop();
182 } 182 }
183 } // namespace base 183 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698