OLD | NEW |
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // If failed to override the key, that means the way has not been registered. | 153 // If failed to override the key, that means the way has not been registered. |
154 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path)) | 154 if (GetTestProviderPath(key, &path) && !PathService::Override(key, path)) |
155 PathService::RegisterProvider(&GetTestProviderPath, key, key + 1); | 155 PathService::RegisterProvider(&GetTestProviderPath, key, key + 1); |
156 } | 156 } |
157 | 157 |
158 } // namespace | 158 } // namespace |
159 | 159 |
160 namespace base { | 160 namespace base { |
161 | 161 |
162 void InitAndroidTestLogging() { | 162 void InitAndroidTestLogging() { |
| 163 if (base::AndroidIsChildProcess()) |
| 164 return; |
| 165 |
163 logging::LoggingSettings settings; | 166 logging::LoggingSettings settings; |
164 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 167 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
165 logging::InitLogging(settings); | 168 logging::InitLogging(settings); |
166 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 169 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
167 logging::SetLogItems(false, // Process ID | 170 logging::SetLogItems(false, // Process ID |
168 false, // Thread ID | 171 false, // Thread ID |
169 false, // Timestamp | 172 false, // Timestamp |
170 false); // Tick count | 173 false); // Tick count |
171 } | 174 } |
172 | 175 |
173 void InitAndroidTestPaths(const FilePath& test_data_dir) { | 176 void InitAndroidTestPaths(const FilePath& test_data_dir) { |
174 if (g_test_data_dir) { | 177 if (g_test_data_dir) { |
175 CHECK(test_data_dir == *g_test_data_dir); | 178 CHECK(test_data_dir == *g_test_data_dir); |
176 return; | 179 return; |
177 } | 180 } |
178 g_test_data_dir = new FilePath(test_data_dir); | 181 g_test_data_dir = new FilePath(test_data_dir); |
179 InitPathProvider(DIR_SOURCE_ROOT); | 182 InitPathProvider(DIR_SOURCE_ROOT); |
180 InitPathProvider(DIR_ANDROID_APP_DATA); | 183 InitPathProvider(DIR_ANDROID_APP_DATA); |
181 } | 184 } |
182 | 185 |
183 void InitAndroidTestMessageLoop() { | 186 void InitAndroidTestMessageLoop() { |
184 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 187 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
185 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 188 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
186 } | 189 } |
187 | 190 |
188 } // namespace base | 191 } // namespace base |
OLD | NEW |