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 | |
166 logging::LoggingSettings settings; | 163 logging::LoggingSettings settings; |
167 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 164 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
168 logging::InitLogging(settings); | 165 logging::InitLogging(settings); |
169 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 166 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
170 logging::SetLogItems(false, // Process ID | 167 logging::SetLogItems(false, // Process ID |
171 false, // Thread ID | 168 false, // Thread ID |
172 false, // Timestamp | 169 false, // Timestamp |
173 false); // Tick count | 170 false); // Tick count |
174 } | 171 } |
175 | 172 |
176 void InitAndroidTestPaths(const FilePath& test_data_dir) { | 173 void InitAndroidTestPaths(const FilePath& test_data_dir) { |
177 if (g_test_data_dir) { | 174 if (g_test_data_dir) { |
178 CHECK(test_data_dir == *g_test_data_dir); | 175 CHECK(test_data_dir == *g_test_data_dir); |
179 return; | 176 return; |
180 } | 177 } |
181 g_test_data_dir = new FilePath(test_data_dir); | 178 g_test_data_dir = new FilePath(test_data_dir); |
182 InitPathProvider(DIR_SOURCE_ROOT); | 179 InitPathProvider(DIR_SOURCE_ROOT); |
183 InitPathProvider(DIR_ANDROID_APP_DATA); | 180 InitPathProvider(DIR_ANDROID_APP_DATA); |
184 } | 181 } |
185 | 182 |
186 void InitAndroidTestMessageLoop() { | 183 void InitAndroidTestMessageLoop() { |
187 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 184 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
188 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 185 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
189 } | 186 } |
190 | 187 |
191 } // namespace base | 188 } // namespace base |
OLD | NEW |