Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: mojo/android/javatests/mojo_test_case.cc

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes to ApplicationStatus Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 23
24 base::ShadowingAtExitManager at_exit; 24 base::ShadowingAtExitManager at_exit;
25 base::MessageLoop message_loop; 25 base::MessageLoop message_loop;
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 Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller) {
34 const JavaParamRef<jobject>& jcaller,
35 const JavaParamRef<jobject>& context) {
36 base::android::InitApplicationContext(env, context);
37 base::InitAndroidTestMessageLoop(); 34 base::InitAndroidTestMessageLoop();
38 } 35 }
39 36
40 static jlong SetupTestEnvironment(JNIEnv* env, 37 static jlong SetupTestEnvironment(JNIEnv* env,
41 const JavaParamRef<jobject>& jcaller) { 38 const JavaParamRef<jobject>& jcaller) {
42 return reinterpret_cast<intptr_t>(new TestEnvironment()); 39 return reinterpret_cast<intptr_t>(new TestEnvironment());
43 } 40 }
44 41
45 static void TearDownTestEnvironment(JNIEnv* env, 42 static void TearDownTestEnvironment(JNIEnv* env,
46 const JavaParamRef<jobject>& jcaller, 43 const JavaParamRef<jobject>& jcaller,
(...skipping 14 matching lines...) Expand all
61 run_loop.RunUntilIdle(); 58 run_loop.RunUntilIdle();
62 } 59 }
63 } 60 }
64 61
65 bool RegisterMojoTestCase(JNIEnv* env) { 62 bool RegisterMojoTestCase(JNIEnv* env) {
66 return RegisterNativesImpl(env); 63 return RegisterNativesImpl(env);
67 } 64 }
68 65
69 } // namespace android 66 } // namespace android
70 } // namespace mojo 67 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698