diff options
author | serya <serya@chromium.org> | 2014-12-15 01:33:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-15 09:33:52 +0000 |
commit | e4584d5cb7327be5e2d76752855757a9e0c2785e (patch) | |
tree | bca0eeb6bec620a8220af7fd22972fd2b831edd5 /components/devtools_bridge/test | |
parent | 2e1a8a3653f0a64de91e6d6673c54d37f9818fbe (diff) | |
download | chromium_src-e4584d5cb7327be5e2d76752855757a9e0c2785e.zip chromium_src-e4584d5cb7327be5e2d76752855757a9e0c2785e.tar.gz chromium_src-e4584d5cb7327be5e2d76752855757a9e0c2785e.tar.bz2 |
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}
Diffstat (limited to 'components/devtools_bridge/test')
6 files changed, 8 insertions, 135 deletions
diff --git a/components/devtools_bridge/test/android/client/DEPS b/components/devtools_bridge/test/android/client/DEPS deleted file mode 100644 index 050660e..0000000 --- a/components/devtools_bridge/test/android/client/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - "+chrome", - "+jni", -] 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 deleted file mode 100644 index 3f35064..0000000 --- a/components/devtools_bridge/test/android/client/javatests/jni/jni_onload.cc +++ /dev/null @@ -1,30 +0,0 @@ -// 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()); -} diff --git a/components/devtools_bridge/test/android/client/javatests/src/org/chromium/components/devtools_bridge/WebClient.java b/components/devtools_bridge/test/android/client/javatests/src/org/chromium/components/devtools_bridge/WebClient.java deleted file mode 100644 index 896710e..0000000 --- a/components/devtools_bridge/test/android/client/javatests/src/org/chromium/components/devtools_bridge/WebClient.java +++ /dev/null @@ -1,27 +0,0 @@ -// 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); -} diff --git a/components/devtools_bridge/test/android/client/web_client_android.cc b/components/devtools_bridge/test/android/client/web_client_android.cc deleted file mode 100644 index 8287a24..0000000 --- a/components/devtools_bridge/test/android/client/web_client_android.cc +++ /dev/null @@ -1,36 +0,0 @@ -// 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 diff --git a/components/devtools_bridge/test/android/client/web_client_android.h b/components/devtools_bridge/test/android/client/web_client_android.h deleted file mode 100644 index 9bca5bc..0000000 --- a/components/devtools_bridge/test/android/client/web_client_android.h +++ /dev/null @@ -1,34 +0,0 @@ -// 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_ diff --git a/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc b/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc index 49fde3a..8fc74800 100644 --- a/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc +++ b/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc @@ -12,11 +12,15 @@ using namespace devtools_bridge::android; JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); JNIEnv* env = base::android::AttachCurrentThread(); - if (!base::android::RegisterLibraryLoaderEntryHook(env) || - !base::android::RegisterJni(env) || - !SessionDependencyFactoryAndroid::InitializeSSL() || - !SessionDependencyFactoryAndroid::RegisterNatives(env)) { + if (!base::android::RegisterLibraryLoaderEntryHook(env)) { return -1; } + if (!base::android::RegisterJni(env)) { + return -1; + } + if (!SessionDependencyFactoryAndroid::InitializeSSL()) { + return -1; + } + SessionDependencyFactoryAndroid::RegisterNatives(env); return JNI_VERSION_1_4; } |