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

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

Issue 2169553002: Properly throw java exceptions from shouldOverrideUrlLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused includes in test_support_android.cc. Created 4 years, 4 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/test_system_message_handler_link_android.cc
diff --git a/base/test/android/test_system_message_handler_link_android.cc b/base/test/android/test_system_message_handler_link_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..26b2174c33b5955dbe93351ab3cfa432ab8ca5a3
--- /dev/null
+++ b/base/test/android/test_system_message_handler_link_android.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2016 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/android/test_system_message_handler_link_android.h"
+
+#include "base/message_loop/message_pump_android.h"
+#include "base/synchronization/waitable_event.h"
+
nyquist 2016/08/18 15:50:03 Nit: Remove empty line.
gsennton 2016/08/18 18:56:54 Done.
+#include "jni/TestSystemMessageHandler_jni.h"
+
+namespace base {
+namespace android {
+
+base::android::ScopedJavaLocalRef<jobject>
+TestSystemMessageHandlerLink::createTestSystemMessageHandler(
+ JNIEnv* env,
+ base::MessagePump::Delegate* delegate,
+ MessagePumpForUI* message_pump,
+ WaitableEvent* test_done_event) {
+ return Java_TestSystemMessageHandler_create(
+ env, reinterpret_cast<intptr_t>(delegate),
+ reinterpret_cast<intptr_t>(message_pump),
+ reinterpret_cast<intptr_t>(test_done_event));
+}
+
+bool TestSystemMessageHandlerLink::RegisterJNI(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+static void NotifyTestDone(JNIEnv* env,
+ const base::android::JavaParamRef<jclass>& jcaller,
+ jlong native_waitable_test_event) {
+ WaitableEvent* event =
+ reinterpret_cast<WaitableEvent*>(native_waitable_test_event);
+ DCHECK(event);
+ event->Signal();
+}
+
+} // namespace android
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698