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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() { |
168 logging::InitLogging(NULL, | 168 logging::LoggingSettings settings; |
169 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 169 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
170 logging::DONT_LOCK_LOG_FILE, | 170 logging::InitLogging(settings); |
171 logging::DELETE_OLD_LOG_FILE, | |
172 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
173 // To view log output with IDs and timestamps use "adb logcat -v threadtime". | 171 // To view log output with IDs and timestamps use "adb logcat -v threadtime". |
174 logging::SetLogItems(false, // Process ID | 172 logging::SetLogItems(false, // Process ID |
175 false, // Thread ID | 173 false, // Thread ID |
176 false, // Timestamp | 174 false, // Timestamp |
177 false); // Tick count | 175 false); // Tick count |
178 } | 176 } |
179 | 177 |
180 void InitAndroidTestPaths() { | 178 void InitAndroidTestPaths() { |
181 InitPathProvider(DIR_MODULE); | 179 InitPathProvider(DIR_MODULE); |
182 InitPathProvider(DIR_ANDROID_APP_DATA); | 180 InitPathProvider(DIR_ANDROID_APP_DATA); |
183 } | 181 } |
184 | 182 |
185 void InitAndroidTestMessageLoop() { | 183 void InitAndroidTestMessageLoop() { |
186 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 184 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
187 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 185 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
188 } | 186 } |
189 | 187 |
190 void InitAndroidTest() { | 188 void InitAndroidTest() { |
191 InitAndroidTestLogging(); | 189 InitAndroidTestLogging(); |
192 InitAndroidTestPaths(); | 190 InitAndroidTestPaths(); |
193 InitAndroidTestMessageLoop(); | 191 InitAndroidTestMessageLoop(); |
194 } | 192 } |
195 } // namespace base | 193 } // namespace base |
OLD | NEW |