| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/message_loop/message_pump_android.h" | 14 #include "base/message_loop/message_pump_android.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "base/test/multiprocess_test.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 struct RunState { | 21 struct RunState { |
| 21 RunState(base::MessagePump::Delegate* delegate, int run_depth) | 22 RunState(base::MessagePump::Delegate* delegate, int run_depth) |
| 22 : delegate(delegate), | 23 : delegate(delegate), |
| 23 run_depth(run_depth), | 24 run_depth(run_depth), |
| 24 should_quit(false) { | 25 should_quit(false) { |
| 25 } | 26 } |
| 26 | 27 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 InitPathProvider(DIR_MODULE); | 170 InitPathProvider(DIR_MODULE); |
| 170 InitPathProvider(DIR_ANDROID_APP_DATA); | 171 InitPathProvider(DIR_ANDROID_APP_DATA); |
| 171 } | 172 } |
| 172 | 173 |
| 173 void InitAndroidTestMessageLoop() { | 174 void InitAndroidTestMessageLoop() { |
| 174 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 175 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
| 175 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 176 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
| 176 } | 177 } |
| 177 | 178 |
| 178 void InitAndroidTest() { | 179 void InitAndroidTest() { |
| 179 InitAndroidTestLogging(); | 180 if (!base::AndroidIsChildProcess()) { |
| 180 InitAndroidTestPaths(); | 181 InitAndroidTestLogging(); |
| 182 InitAndroidTestPaths(); |
| 183 } |
| 181 InitAndroidTestMessageLoop(); | 184 InitAndroidTestMessageLoop(); |
| 182 } | 185 } |
| 183 } // namespace base | 186 } // namespace base |
| OLD | NEW |