Commit e4584d5c authored by serya's avatar serya Committed by Commit bot

Revert of Stub for web-base client for DevTools bridge and tests (patchset #5...

Revert of Stub for web-base client for DevTools bridge and tests (patchset #5 id:100001 of https://codereview.chromium.org/736363002/)

Reason for revert:
Reverting since now DevToolsBridgeClient (https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/devtools/device/webrtc/devtools_bridge_client.h) is that WebClient supposed to be. All further code will be placed there.

Original issue's description:
> Stub for web-base client for DevTools bridge and tests
>
> This patch mostly consists of testing environment for web WebClient. While
> WebClient intended to be base for a new DeviceProvider in DevTools frontend
> (https://codereview.chromium.org/720133002/) it is convinient to run
> tests on android. It lets to test the client directly against server
> counterpart avoiding flakiness of network and cloud services.
>
> TBR=jochen@chromium.org
> BUG=383418
>
> Committed: https://crrev.com/ff7a801dfddaa22643accaf3e0df192470fb7a7b
> Cr-Commit-Position: refs/heads/master@{#305131}

TBR=mnaganov@chromium.org,dgozman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=383418

Review URL: https://codereview.chromium.org/802293002

Cr-Commit-Position: refs/heads/master@{#308329}
parent 2e1a8a36
...@@ -885,7 +885,6 @@ ...@@ -885,7 +885,6 @@
['enable_webrtc==1 and "<(libpeer_target_type)"=="static_library"', { ['enable_webrtc==1 and "<(libpeer_target_type)"=="static_library"', {
'dependencies': [ 'dependencies': [
'../components/devtools_bridge.gyp:devtools_bridge_tests_apk', '../components/devtools_bridge.gyp:devtools_bridge_tests_apk',
'../components/devtools_bridge.gyp:libdevtools_bridge_browsertests',
], ],
}], }],
], ],
...@@ -901,7 +900,6 @@ ...@@ -901,7 +900,6 @@
'../tools/android/android_tools.gyp:memconsumer', '../tools/android/android_tools.gyp:memconsumer',
# Unit test bundles packaged as an apk. # Unit test bundles packaged as an apk.
'../components/devtools_bridge.gyp:devtools_bridge_tests_apk', '../components/devtools_bridge.gyp:devtools_bridge_tests_apk',
'../components/devtools_bridge.gyp:libdevtools_bridge_browsertests',
'../content/content_shell_and_tests.gyp:content_browsertests_apk', '../content/content_shell_and_tests.gyp:content_browsertests_apk',
], ],
}, # target_name: android_builder_chromium_webrtc }, # target_name: android_builder_chromium_webrtc
......
...@@ -3,16 +3,12 @@ ...@@ -3,16 +3,12 @@
# found in the LICENSE file. # found in the LICENSE file.
{ {
'includes': [
'../build/util/version.gypi',
],
'targets': [ 'targets': [
{ {
'target_name': 'devtools_bridge_jni_headers', 'target_name': 'devtools_bridge_jni_headers',
'type': 'none', 'type': 'none',
'sources': [ 'sources': [
'devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/SessionDependencyFactoryNative.java', 'devtools_bridge/android/java/src/org/chromium/components/devtools_bridge/SessionDependencyFactoryNative.java',
'devtools_bridge/test/android/client/javatests/src/org/chromium/components/devtools_bridge/WebClient.java',
], ],
'variables': { 'variables': {
'jni_gen_package': 'devtools_bridge', 'jni_gen_package': 'devtools_bridge',
...@@ -20,38 +16,38 @@ ...@@ -20,38 +16,38 @@
'includes': [ '../build/jni_generator.gypi' ], 'includes': [ '../build/jni_generator.gypi' ],
}, },
{ {
'target_name': 'devtools_bridge_server', 'target_name': 'devtools_bridge',
'type': 'static_library', 'type': 'static_library',
'sources': [ 'sources': [
'devtools_bridge/android/session_dependency_factory_android.cc', 'devtools_bridge/android/session_dependency_factory_android.cc',
'devtools_bridge/android/session_dependency_factory_android.h', 'devtools_bridge/android/session_dependency_factory_android.h',
'devtools_bridge/session_dependency_factory.cc',
'devtools_bridge/session_dependency_factory.h',
'devtools_bridge/socket_tunnel_connection.cc', 'devtools_bridge/socket_tunnel_connection.cc',
'devtools_bridge/socket_tunnel_connection.h', 'devtools_bridge/socket_tunnel_connection.h',
'devtools_bridge/socket_tunnel_packet_handler.cc', 'devtools_bridge/socket_tunnel_packet_handler.cc',
'devtools_bridge/socket_tunnel_packet_handler.h', 'devtools_bridge/socket_tunnel_packet_handler.h',
'devtools_bridge/socket_tunnel_server.cc', 'devtools_bridge/socket_tunnel_server.cc',
'devtools_bridge/socket_tunnel_server.h', 'devtools_bridge/socket_tunnel_server.h',
'devtools_bridge/session_dependency_factory.cc',
'devtools_bridge/session_dependency_factory.h',
], ],
'dependencies': [ 'dependencies': [
'<(DEPTH)/base/base.gyp:base', '../base/base.gyp:base',
'<(DEPTH)/third_party/libjingle/libjingle.gyp:libjingle_webrtc', '../third_party/libjingle/libjingle.gyp:libjingle_webrtc',
'<(DEPTH)/third_party/libjingle/libjingle.gyp:libpeerconnection', '../third_party/libjingle/libjingle.gyp:libpeerconnection',
'<(DEPTH)/third_party/webrtc/base/base.gyp:webrtc_base', '../third_party/webrtc/base/base.gyp:webrtc_base',
'devtools_bridge_jni_headers', 'devtools_bridge_jni_headers',
], ],
}, },
{ {
'target_name': 'devtools_bridge_server_javalib', 'target_name': 'devtools_bridge_javalib',
'type': 'none', 'type': 'none',
'variables': { 'variables': {
'java_in_dir': 'devtools_bridge/android/java', 'java_in_dir': 'devtools_bridge/android/java',
}, },
'includes': [ '../build/java.gypi' ], 'includes': [ '../build/java.gypi' ],
'dependencies': [ 'dependencies': [
'<(DEPTH)/base/base.gyp:base_java', '../third_party/android_tools/android_tools.gyp:android_gcm',
'<(DEPTH)/third_party/android_tools/android_tools.gyp:android_gcm', '../base/base.gyp:base_java',
], ],
}, },
{ {
...@@ -61,8 +57,8 @@ ...@@ -61,8 +57,8 @@
'devtools_bridge/test/android/javatests/jni/jni_onload.cc', 'devtools_bridge/test/android/javatests/jni/jni_onload.cc',
], ],
'dependencies': [ 'dependencies': [
'<(DEPTH)/base/base.gyp:base', '../base/base.gyp:base',
'devtools_bridge_server', 'devtools_bridge',
], ],
}, },
{ {
...@@ -73,14 +69,14 @@ ...@@ -73,14 +69,14 @@
}, },
'includes': [ '../build/java.gypi' ], 'includes': [ '../build/java.gypi' ],
'dependencies': [ 'dependencies': [
'devtools_bridge_server_javalib', 'devtools_bridge_javalib',
], ],
}, },
{ {
'target_name': 'devtools_bridge_tests_apk', 'target_name': 'devtools_bridge_tests_apk',
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'devtools_bridge_server_javalib', 'devtools_bridge_javalib',
'devtools_bridge_testutils', 'devtools_bridge_testutils',
'libdevtools_bridge_natives_so', 'libdevtools_bridge_natives_so',
], ],
...@@ -93,93 +89,5 @@ ...@@ -93,93 +89,5 @@
}, },
'includes': [ '../build/java_apk.gypi' ], 'includes': [ '../build/java_apk.gypi' ],
}, },
{
'target_name': 'libdevtools_bridge_browsertests',
'type': 'shared_library',
'sources': [
'devtools_bridge/test/android/client/javatests/jni/jni_onload.cc',
'devtools_bridge/test/android/client/web_client_android.cc',
'devtools_bridge/test/android/client/web_client_android.h',
],
'dependencies': [
'<(DEPTH)/chrome/chrome.gyp:libchromeshell_base',
'devtools_bridge_client',
'devtools_bridge_jni_headers',
'devtools_bridge_server',
],
},
{
'target_name': 'devtools_bridge_browsertests_resources',
'type': 'none',
'dependencies': [
'<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
],
'variables': {
'asset_location': '<(PRODUCT_DIR)/devtools_bridge_browsertests_apk/assets',
},
'inputs': [
'<(PRODUCT_DIR)/chrome_100_percent.pak',
'<(PRODUCT_DIR)/locales/en-US.pak',
'<(PRODUCT_DIR)/resources.pak',
],
'copies': [
{
'destination': '<(asset_location)',
'files': [
'<(PRODUCT_DIR)/chrome_100_percent.pak',
'<(PRODUCT_DIR)/locales/en-US.pak',
'<(PRODUCT_DIR)/resources.pak',
],
'conditions': [
['icu_use_data_file_flag==1', {
'files': [ '<(PRODUCT_DIR)/icudtl.dat' ],
}],
['v8_use_external_startup_data==1', {
'files': [
'<(PRODUCT_DIR)/natives_blob.bin',
'<(PRODUCT_DIR)/snapshot_blob.bin',
],
}],
],
},
],
},
{
'target_name': 'devtools_bridge_browsertests_apk',
'type': 'none',
'dependencies': [
'<(DEPTH)/base/base.gyp:base_java',
'<(DEPTH)/chrome/chrome.gyp:chrome_java',
'devtools_bridge_browsertests_resources',
'devtools_bridge_server_javalib',
'libdevtools_bridge_browsertests',
],
'variables': {
'apk_name': 'DevToolsBridgeBrowserTests',
'test_suite_name': 'devtools_bridge_tests',
'java_in_dir': 'devtools_bridge/android/client/javatests',
'additional_src_dirs': ['devtools_bridge/test/android/client/javatests'],
'native_lib_target': 'libdevtools_bridge_browsertests',
'asset_location': '<(PRODUCT_DIR)/devtools_bridge_browsertests_apk/assets',
'native_lib_version_name': '<(version_full)',
'is_test_apk': 1,
},
'includes': [ '../build/java_apk.gypi' ],
},
# TODO(serya): Separate from android targets. Otherwise it may not be
# used outside of android.
{
'target_name': 'devtools_bridge_client',
'type': 'static_library',
'sources': [
'devtools_bridge/client/web_client.cc',
'devtools_bridge/client/web_client.h',
],
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/content/content.gyp:content',
],
},
], ],
} }
include_rules = [ include_rules = [
"-chrome",
"-content",
"+net", "+net",
"+third_party/libjingle", "+third_party/libjingle",
"+third_party/webrtc", "+third_party/webrtc",
......
<?xml version="1.0" encoding="utf-8"?>
<!-- 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. -->
<!-- package name must be unique so suffix with "tests" so package loader
doesn't ignore this. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.chromium.components.devtools_bridge.browsertests">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.INJECT_EVENTS" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application android:name=".TestApplication"
android:debuggable="true">
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="org.chromium.components.devtools_bridge.browsertests"
android:label="Tests for DevTols bride client"/>
</manifest>
// 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.
package org.chromium.components.devtools_bridge;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.content.browser.BrowserStartupController;
import java.util.concurrent.Callable;
/**
* Tests for {@link WebClient}. WebClient is not intended to run on Android but
* it can. It is useful for tests: we can test it against the server in the
* same process (without dependency on network and cloud services).
*/
public class WebClientTest extends InstrumentationTestCase {
private Profile mProfile;
protected void startChromeBrowserProcessSyncOnUIThread() throws Exception {
BrowserStartupController.get(getInstrumentation().getTargetContext())
.startBrowserProcessesSync(false);
mProfile = Profile.getLastUsedProfile();
}
@SmallTest
public void testCreationWebClient() throws Exception {
ThreadUtils.runOnUiThreadBlocking(new Callable<Void>() {
@Override
public Void call() throws Exception {
startChromeBrowserProcessSyncOnUIThread();
assert mProfile != null;
new WebClient(mProfile).dispose();
return null;
}
});
}
}
// Copyright 2013 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.
package org.chromium.components.devtools_bridge.browsertests;
import android.content.Context;
import org.chromium.base.CommandLine;
import org.chromium.base.PathUtils;
import org.chromium.base.ResourceExtractor;
import org.chromium.chrome.browser.ChromiumApplication;
import org.chromium.chrome.browser.PKCS11AuthenticationManager;
import org.chromium.net.AndroidPrivateKey;
import java.security.cert.X509Certificate;
/**
* Host application for DevTools Bridge client code tests.
*/
public class TestApplication extends ChromiumApplication {
private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "devtools_bridge";
private static final String[] MANDATORY_PAKS = {
"en-US.pak",
"icudtl.dat",
"natives_blob.bin",
"resources.pak",
"snapshot_blob.bin"
};
@Override
public void onCreate() {
super.onCreate();
ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAKS);
PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
}
@Override
public void initCommandLine() {
if (!CommandLine.isInitialized()) {
CommandLine.init(null);
}
}
@Override
protected PKCS11AuthenticationManager getPKCS11AuthenticationManager() {
return new PKCS11AuthenticationManager() {
@Override
public boolean isPKCS11AuthEnabled() {
return false;
}
@Override
public String getClientCertificateAlias(String hostName, int port) {
return null;
}
@Override
public void initialize(Context context) {
}
@Override
public X509Certificate[] getCertificateChain(String alias) {
return null;
}
@Override
public AndroidPrivateKey getPrivateKey(String alias) {
return null;
}
};
}
@Override
protected boolean areParentalControlsEnabled() {
return false;
}
}
...@@ -146,8 +146,8 @@ SessionDependencyFactoryAndroid::~SessionDependencyFactoryAndroid() { ...@@ -146,8 +146,8 @@ SessionDependencyFactoryAndroid::~SessionDependencyFactoryAndroid() {
} }
// static // static
bool SessionDependencyFactoryAndroid::RegisterNatives(JNIEnv* env) { void SessionDependencyFactoryAndroid::RegisterNatives(JNIEnv* env) {
return RegisterNativesImpl(env); RegisterNativesImpl(env);
} }
scoped_ptr<AbstractPeerConnection> scoped_ptr<AbstractPeerConnection>
......
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
#ifndef COMPONENTS_DEVTOOLS_BRIDGE_ANDROID_SESSION_DEPENDENCY_FACTORY_ANDROID_H_ #ifndef COMPONENTS_DEVTOOLS_BRIDGE_ANDROID_SESSION_DEPENDENCY_FACTORY_ANDROID_H_
#define COMPONENTS_DEVTOOLS_BRIDGE_ANDROID_SESSION_DEPENDENCY_FACTORY_ANDROID_H_ #define COMPONENTS_DEVTOOLS_BRIDGE_ANDROID_SESSION_DEPENDENCY_FACTORY_ANDROID_H_
#include <jni.h>
#include "components/devtools_bridge/session_dependency_factory.h" #include "components/devtools_bridge/session_dependency_factory.h"
#include "jni.h"
namespace devtools_bridge { namespace devtools_bridge {
namespace android { namespace android {
...@@ -17,7 +16,7 @@ class SessionDependencyFactoryAndroid : public SessionDependencyFactory { ...@@ -17,7 +16,7 @@ class SessionDependencyFactoryAndroid : public SessionDependencyFactory {
SessionDependencyFactoryAndroid(); SessionDependencyFactoryAndroid();
virtual ~SessionDependencyFactoryAndroid(); virtual ~SessionDependencyFactoryAndroid();
static bool RegisterNatives(JNIEnv* env); static void RegisterNatives(JNIEnv* env);
virtual scoped_ptr<AbstractPeerConnection> CreatePeerConnection( virtual scoped_ptr<AbstractPeerConnection> CreatePeerConnection(
scoped_ptr<RTCConfiguration> config, scoped_ptr<RTCConfiguration> config,
......
include_rules = [
"+content/public",
"-third_party/libjingle",
"-third_party/webrtc",
]
// 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 "components/devtools_bridge/client/web_client.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
namespace devtools_bridge {
namespace {
class WebClientImpl : public WebClient, private content::WebContentsDelegate {
public:
WebClientImpl(content::BrowserContext* context, Delegate* delegate);
private:
Delegate* const delegate_;
const scoped_ptr<content::WebContents> web_contents_;
};
WebClientImpl::WebClientImpl(content::BrowserContext* context,
Delegate* delegate)
: delegate_(delegate),
web_contents_(content::WebContents::Create(
content::WebContents::CreateParams(context))) {
web_contents_->SetDelegate(this);
}
} // namespace
scoped_ptr<WebClient> WebClient::CreateInstance(
content::BrowserContext* context, Delegate* delegate) {
return make_scoped_ptr(new WebClientImpl(context, delegate));
}
} // namespace devtools_bridge
// 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.
#ifndef COMPONENTS_DEVTOOLS_BRIDGE_CLIENT_WEB_CLIENT_H_
#define COMPONENTS_DEVTOOLS_BRIDGE_CLIENT_WEB_CLIENT_H_
#include "base/memory/scoped_ptr.h"
namespace content {
class BrowserContext;
}
namespace devtools_bridge {
/**
* Client for DevTools Bridge for desktop Chrome. Uses WebContents to host
* JavaScript implementation (therefore lives on the UI thread and must be
* destroyed before |context|). WebContents works as a sandbox for WebRTC
* related code.
*/
class WebClient {
public:
class Delegate {
public:
// TODO(serya): implement
};
virtual ~WebClient() {}
static scoped_ptr<WebClient> CreateInstance(
content::BrowserContext* context, Delegate* delegate);
// TODO(serya): Implement.
protected:
WebClient() {}
private:
DISALLOW_COPY_AND_ASSIGN(WebClient);
};
} // namespace devtools_bridge
#endif // COMPONENTS_DEVTOOLS_BRIDGE_CLIENT_WEB_CLIENT_H_
// 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());
}
// 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.
package org.chromium.components.devtools_bridge;
import org.chromium.base.JNINamespace;
import org.chromium.chrome.browser.profiles.Profile;
/**
* Java wrapper over native WebClient for tests.
*/
@JNINamespace("devtools_bridge::android")
public final class WebClient {
private final long mWebClientPtr;
public WebClient(Profile profile) {
mWebClientPtr = nativeCreateWebClient(profile);
}
public void dispose() {
nativeDestroyWebClient(mWebClientPtr);
}
private static native long nativeCreateWebClient(Profile profile);
private static native void nativeDestroyWebClient(long webClientPtr);
}
// 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 "components/devtools_bridge/test/android/client/web_client_android.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
#include "jni/WebClient_jni.h"
namespace devtools_bridge {
namespace android {
bool WebClientAndroid::RegisterNatives(JNIEnv* env) {
return RegisterNativesImpl(env);
}
WebClientAndroid::WebClientAndroid(Profile* profile)
: impl_(WebClient::CreateInstance(profile, this)) {
}
WebClientAndroid::~WebClientAndroid() {
}
static jlong CreateWebClient(JNIEnv* env, jclass jcaller, jobject j_profile) {
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
return reinterpret_cast<jlong>(new WebClientAndroid(profile));
}
static void DestroyWebClient(
JNIEnv* env, jclass jcaller, jlong web_client_ptr) {
delete reinterpret_cast<WebClientAndroid*>(web_client_ptr);
}
} // namespace android
} // namespace devtools_bridge
// 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.
#ifndef COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_
#define COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_
#include <jni.h>
#include "components/devtools_bridge/client/web_client.h"
class Profile;
namespace devtools_bridge {
namespace android {
/**
* Android wrapper over WebClient for Java tests. See WebClientTest.java.
*/
class WebClientAndroid : private WebClient::Delegate {
public:
static bool RegisterNatives(JNIEnv* env);
WebClientAndroid(Profile* profile);
~WebClientAndroid();
private:
scoped_ptr<WebClient> impl_;
};
} // namespace android
} // namespace devtools_bridge
#endif // COMPONENTS_DEVTOOLS_BRIDGE_TEST_ANDROID_CLIENT_WEB_CLIENT_ANDROID_H_
...@@ -12,11 +12,15 @@ using namespace devtools_bridge::android; ...@@ -12,11 +12,15 @@ using namespace devtools_bridge::android;
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
base::android::InitVM(vm); base::android::InitVM(vm);
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
if (!base::android::RegisterLibraryLoaderEntryHook(env) || if (!base::android::RegisterLibraryLoaderEntryHook(env)) {
!base::android::RegisterJni(env) ||
!SessionDependencyFactoryAndroid::InitializeSSL() ||
!SessionDependencyFactoryAndroid::RegisterNatives(env)) {
return -1; return -1;
} }
if (!base::android::RegisterJni(env)) {
return -1;
}
if (!SessionDependencyFactoryAndroid::InitializeSSL()) {
return -1;
}
SessionDependencyFactoryAndroid::RegisterNatives(env);
return JNI_VERSION_1_4; return JNI_VERSION_1_4;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment