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/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 }; | 26 }; |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 namespace mojo { | 30 namespace mojo { |
31 namespace android { | 31 namespace android { |
32 | 32 |
33 static void InitApplicationContext(JNIEnv* env, | 33 static void InitApplicationContext(JNIEnv* env, |
34 const JavaParamRef<jobject>& jcaller, | 34 const JavaParamRef<jobject>& jcaller, |
35 const JavaParamRef<jobject>& context) { | 35 const JavaParamRef<jobject>& context) { |
36 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); | 36 base::android::InitApplicationContext(env, context); |
37 base::android::InitApplicationContext(env, scoped_context); | |
38 base::InitAndroidTestMessageLoop(); | 37 base::InitAndroidTestMessageLoop(); |
39 } | 38 } |
40 | 39 |
41 static jlong SetupTestEnvironment(JNIEnv* env, | 40 static jlong SetupTestEnvironment(JNIEnv* env, |
42 const JavaParamRef<jobject>& jcaller) { | 41 const JavaParamRef<jobject>& jcaller) { |
43 return reinterpret_cast<intptr_t>(new TestEnvironment()); | 42 return reinterpret_cast<intptr_t>(new TestEnvironment()); |
44 } | 43 } |
45 | 44 |
46 static void TearDownTestEnvironment(JNIEnv* env, | 45 static void TearDownTestEnvironment(JNIEnv* env, |
47 const JavaParamRef<jobject>& jcaller, | 46 const JavaParamRef<jobject>& jcaller, |
(...skipping 15 matching lines...) Expand all Loading... |
63 run_loop.RunUntilIdle(); | 62 run_loop.RunUntilIdle(); |
64 } | 63 } |
65 } | 64 } |
66 | 65 |
67 bool RegisterMojoTestCase(JNIEnv* env) { | 66 bool RegisterMojoTestCase(JNIEnv* env) { |
68 return RegisterNativesImpl(env); | 67 return RegisterNativesImpl(env); |
69 } | 68 } |
70 | 69 |
71 } // namespace android | 70 } // namespace android |
72 } // namespace mojo | 71 } // namespace mojo |
OLD | NEW |