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

Unified Diff: base/test/test_ui_thread_android.cc

Issue 1162763004: Provide dummy Android UI thread with looper for C++ unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add BUILD.gn changes Created 5 years, 6 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
« base/test/test_ui_thread_android.h ('K') | « base/test/test_ui_thread_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_ui_thread_android.cc
diff --git a/base/test/test_ui_thread_android.cc b/base/test/test_ui_thread_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6f19974cefda327b18cceaec42f71cf377c5e442
--- /dev/null
+++ b/base/test/test_ui_thread_android.cc
@@ -0,0 +1,18 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "base/test/test_ui_thread_android.h"
+
+#include "jni/TestUiThread_jni.h"
+
+namespace base {
+
+void StartTestUiThreadLooper() {
+ Java_TestUiThread_loop(base::android::AttachCurrentThread());
+}
+
+bool RegisterTestUiThreadAndroid(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace base
« base/test/test_ui_thread_android.h ('K') | « base/test/test_ui_thread_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698