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 "content/shell/browser/shell_mojo_test_utils_android.h" | 5 #include "content/shell/browser/shell_mojo_test_utils_android.h" |
6 | 6 |
7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "content/browser/mojo/service_registry_android.h" | 10 #include "content/browser/mojo/service_registry_android.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 test_environment->wrappers.push_back(wrapper_b); | 62 test_environment->wrappers.push_back(wrapper_b); |
63 | 63 |
64 return Java_ShellMojoTestUtils_makePair(env, wrapper_a->GetObj().obj(), | 64 return Java_ShellMojoTestUtils_makePair(env, wrapper_a->GetObj().obj(), |
65 wrapper_b->GetObj().obj()); | 65 wrapper_b->GetObj().obj()); |
66 } | 66 } |
67 | 67 |
68 static void RunLoop(JNIEnv* env, | 68 static void RunLoop(JNIEnv* env, |
69 const JavaParamRef<jclass>& jcaller, | 69 const JavaParamRef<jclass>& jcaller, |
70 jlong timeout_ms) { | 70 jlong timeout_ms) { |
71 base::MessageLoop::current()->PostDelayedTask( | 71 base::MessageLoop::current()->PostDelayedTask( |
72 FROM_HERE, | 72 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
73 base::MessageLoop::QuitClosure(), | |
74 base::TimeDelta::FromMilliseconds(timeout_ms)); | 73 base::TimeDelta::FromMilliseconds(timeout_ms)); |
75 base::RunLoop run_loop; | 74 base::RunLoop run_loop; |
76 run_loop.Run(); | 75 run_loop.Run(); |
77 } | 76 } |
78 | 77 |
79 bool RegisterShellMojoTestUtils(JNIEnv* env) { | 78 bool RegisterShellMojoTestUtils(JNIEnv* env) { |
80 return RegisterNativesImpl(env); | 79 return RegisterNativesImpl(env); |
81 } | 80 } |
82 | 81 |
83 } // namespace content | 82 } // namespace content |
OLD | NEW |