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

Unified Diff: base/test/android/java_handler_thread_for_testing.cc

Issue 2774363003: android: Java-based launcher thread (Closed)
Patch Set: comment on test Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: base/test/android/java_handler_thread_for_testing.cc
diff --git a/base/test/android/java_handler_thread_for_testing.cc b/base/test/android/java_handler_thread_for_testing.cc
index fe5234761cbbc3e0095ce81b4ce3641ccecfc107..c5cd1c35ff4f9bce2aab6c236075ee27a01bd24b 100644
--- a/base/test/android/java_handler_thread_for_testing.cc
+++ b/base/test/android/java_handler_thread_for_testing.cc
@@ -5,6 +5,7 @@
#include "base/test/android/java_handler_thread_for_testing.h"
#include "base/message_loop/message_loop.h"
+#include "jni/JavaHandlerThreadTest_jni.h"
namespace base {
namespace android {
@@ -26,13 +27,18 @@ JavaHandlerThreadForTesting::JavaHandlerThreadForTesting(
message_handler_factory_(new TestJavaMessageHandlerFactory()),
test_done_event_(test_done_event) {}
+JavaHandlerThreadForTesting::JavaHandlerThreadForTesting(
+ base::WaitableEvent* test_done_event)
+ : JavaHandlerThread(Java_JavaHandlerThreadTest_testAndGetJavaHandlerThread(
+ base::android::AttachCurrentThread())),
+ message_handler_factory_(new TestJavaMessageHandlerFactory()),
+ test_done_event_(test_done_event) {}
+
JavaHandlerThreadForTesting::~JavaHandlerThreadForTesting() = default;
void JavaHandlerThreadForTesting::StartMessageLoop() {
static_cast<MessageLoopForUI*>(message_loop_.get())
- ->StartForTesting(
- message_handler_factory_.get(),
- reinterpret_cast<base::WaitableEvent*>(test_done_event_));
+ ->StartForTesting(message_handler_factory_.get(), test_done_event_);
}
void JavaHandlerThreadForTesting::StopMessageLoop() {

Powered by Google App Engine
This is Rietveld 408576698