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

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

Issue 1402533003: Don't use base::MessageLoop::{Quit,QuitClosure} in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « no previous file | mojo/android/system/base_run_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 jlong test_environment) { 47 jlong test_environment) {
48 delete reinterpret_cast<TestEnvironment*>(test_environment); 48 delete reinterpret_cast<TestEnvironment*>(test_environment);
49 } 49 }
50 50
51 static void RunLoop(JNIEnv* env, 51 static void RunLoop(JNIEnv* env,
52 const JavaParamRef<jobject>& jcaller, 52 const JavaParamRef<jobject>& jcaller,
53 jlong timeout_ms) { 53 jlong timeout_ms) {
54 base::RunLoop run_loop; 54 base::RunLoop run_loop;
55 if (timeout_ms) { 55 if (timeout_ms) {
56 base::MessageLoop::current()->PostDelayedTask( 56 base::MessageLoop::current()->PostDelayedTask(
57 FROM_HERE, 57 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
58 base::MessageLoop::QuitClosure(),
59 base::TimeDelta::FromMilliseconds(timeout_ms)); 58 base::TimeDelta::FromMilliseconds(timeout_ms));
60 run_loop.Run(); 59 run_loop.Run();
61 } else { 60 } else {
62 run_loop.RunUntilIdle(); 61 run_loop.RunUntilIdle();
63 } 62 }
64 } 63 }
65 64
66 bool RegisterMojoTestCase(JNIEnv* env) { 65 bool RegisterMojoTestCase(JNIEnv* env) {
67 return RegisterNativesImpl(env); 66 return RegisterNativesImpl(env);
68 } 67 }
69 68
70 } // namespace android 69 } // namespace android
71 } // namespace mojo 70 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/android/system/base_run_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698