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

Unified Diff: components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc

Issue 736363002: Stub for web-base client for DevTools bridge and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed presubmits Created 6 years, 1 month 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: components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc
diff --git a/components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc b/components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3f350645d7a21633e2a572971de05f54cf14384e
--- /dev/null
+++ b/components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc
@@ -0,0 +1,30 @@
+// Copyright 2014 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/android/base_jni_registrar.h"
+#include "base/android/jni_android.h"
+#include "base/android/library_loader/library_loader_hooks.h"
+#include "chrome/app/android/chrome_android_initializer.h"
+#include "chrome/app/android/chrome_main_delegate_android.h"
+#include "components/devtools_bridge/android/session_dependency_factory_android.h"
+#include "components/devtools_bridge/test/android/client/web_client_android.h"
+
+using namespace devtools_bridge::android;
+
+namespace {
+
+class Delegate : public ChromeMainDelegateAndroid {
+ public:
+ bool RegisterApplicationNativeMethods(JNIEnv* env) override {
+ return ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(env) &&
+ SessionDependencyFactoryAndroid::InitializeSSL() &&
+ WebClientAndroid::RegisterNatives(env);
+ }
+};
+
+} // namespace
+
+JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
+ return RunChrome(vm, new Delegate());
+}

Powered by Google App Engine
This is Rietveld 408576698