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/jni_android.h" |
8 #include "base/android/path_utils.h" | 9 #include "base/android/path_utils.h" |
9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
14 #include "base/message_loop/message_pump_android.h" | 15 #include "base/message_loop/message_pump_android.h" |
15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
16 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "base/test/android/test_system_message_handler_link_android.h" |
17 #include "base/test/multiprocess_test.h" | 19 #include "base/test/multiprocess_test.h" |
18 | 20 |
19 namespace { | 21 namespace { |
20 | 22 |
21 base::FilePath* g_test_data_dir = nullptr; | 23 base::FilePath* g_test_data_dir = nullptr; |
22 | 24 |
23 struct RunState { | 25 struct RunState { |
24 RunState(base::MessagePump::Delegate* delegate, int run_depth) | 26 RunState(base::MessagePump::Delegate* delegate, int run_depth) |
25 : delegate(delegate), | 27 : delegate(delegate), |
26 run_depth(run_depth), | 28 run_depth(run_depth), |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 184 |
183 void InitAndroidTestMessageLoop() { | 185 void InitAndroidTestMessageLoop() { |
184 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) | 186 if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIStub)) |
185 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; | 187 LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; |
186 } | 188 } |
187 | 189 |
188 void InitAndroidTest() { | 190 void InitAndroidTest() { |
189 if (!base::AndroidIsChildProcess()) { | 191 if (!base::AndroidIsChildProcess()) { |
190 InitAndroidTestLogging(); | 192 InitAndroidTestLogging(); |
191 } | 193 } |
| 194 base::android::TestSystemMessageHandlerLink::RegisterJNI( |
| 195 base::android::AttachCurrentThread()); |
192 InitAndroidTestMessageLoop(); | 196 InitAndroidTestMessageLoop(); |
193 } | 197 } |
194 } // namespace base | 198 } // namespace base |
OLD | NEW |