OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/android/javatests/mojo_test_case.h" | 5 #include "mojo/android/javatests/mojo_test_case.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/at_exit.h" |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
13 #include "base/test/test_support_android.h" | 14 #include "base/test/test_support_android.h" |
14 #include "jni/MojoTestCase_jni.h" | 15 #include "jni/MojoTestCase_jni.h" |
15 #include "mojo/public/cpp/environment/environment.h" | 16 #include "mojo/public/cpp/environment/environment.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 struct TestEnvironment { | 20 struct TestEnvironment { |
20 mojo::Environment environment; | 21 base::ShadowingAtExitManager at_exit; |
21 base::MessageLoopForUI message_loop; | 22 base::MessageLoopForUI message_loop; |
22 }; | 23 }; |
23 | 24 |
24 } // namespace | 25 } // namespace |
25 | 26 |
26 namespace mojo { | 27 namespace mojo { |
27 namespace android { | 28 namespace android { |
28 | 29 |
29 static void InitApplicationContext(JNIEnv* env, | 30 static void InitApplicationContext(JNIEnv* env, |
30 jobject jcaller, | 31 jobject jcaller, |
(...skipping 21 matching lines...) Expand all Loading... |
52 base::RunLoop run_loop; | 53 base::RunLoop run_loop; |
53 run_loop.Run(); | 54 run_loop.Run(); |
54 } | 55 } |
55 | 56 |
56 bool RegisterMojoTestCase(JNIEnv* env) { | 57 bool RegisterMojoTestCase(JNIEnv* env) { |
57 return RegisterNativesImpl(env); | 58 return RegisterNativesImpl(env); |
58 } | 59 } |
59 | 60 |
60 } // namespace android | 61 } // namespace android |
61 } // namespace mojo | 62 } // namespace mojo |
OLD | NEW |