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

Unified Diff: android_webview/test/embeddedtestserver/aw_test_jni_onload.cc

Issue 2687573002: [Android Webview] Refactor LoadUrlTest and work on embedded_test_server custom handler (Closed)
Patch Set: John comment & url encode 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: android_webview/test/embeddedtestserver/aw_test_jni_onload.cc
diff --git a/android_webview/test/embeddedtestserver/aw_test_jni_onload.cc b/android_webview/test/embeddedtestserver/aw_test_jni_onload.cc
new file mode 100644
index 0000000000000000000000000000000000000000..72b6696d1a3f6b8600a33f796c6b21c29de6a2a0
--- /dev/null
+++ b/android_webview/test/embeddedtestserver/aw_test_jni_onload.cc
@@ -0,0 +1,43 @@
+// Copyright 2017 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 "android_webview/test/embeddedtestserver/aw_test_jni_onload.h"
+
+#include "android_webview/test/embeddedtestserver/custom_handlers.h"
+#include "base/android/base_jni_onload.h"
+#include "base/android/base_jni_registrar.h"
+#include "base/android/jni_android.h"
+#include "base/bind.h"
+#include "base/trace_event/trace_event.h"
+#include "net/test/embedded_test_server/android/embedded_test_server_android.h"
+
+namespace android_webview {
+namespace test {
+
+namespace {
+
+bool RegisterJNI(JNIEnv* env) {
+ return net::test_server::EmbeddedTestServerAndroid::
jbudorick 2017/03/13 23:32:54 hmm, can we have the net code handle this and just
shenghuazhang 2017/03/17 01:07:15 Done.
+ RegisterEmbeddedTestServerAndroid(env);
+}
+
+bool RegisterHandlersJNI(JNIEnv* env) {
jbudorick 2017/03/13 23:32:54 w/ the change above, we could rename this to just
shenghuazhang 2017/03/17 01:07:15 Done.
+ TRACE_EVENT0("native", "android_webview::test::RegisterHandlersJNI");
+ return android_webview::test::RegisterCustomHandlers(env);
+}
+
+} // namesapce
+
+bool OnJNIOnLoadRegisterJNI(JNIEnv* env) {
+ return base::android::OnJNIOnLoadRegisterJNI(env) &&
+ base::android::RegisterJni(env) && RegisterHandlersJNI(env) &&
+ RegisterJNI(env);
+}
+
+bool OnJNIOnLoadInit() {
+ return base::android::OnJNIOnLoadInit();
+}
+
+} // namespace test
+} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698