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

Unified Diff: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/DevToolsBridgeServerSandbox.java

Issue 1142463003: Remove devtools_bridge component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/DevToolsBridgeServerSandbox.java
diff --git a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/DevToolsBridgeServerSandbox.java b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/DevToolsBridgeServerSandbox.java
deleted file mode 100644
index 7364e0cc4146b46ee7f052984128a3db15cdd6b5..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/DevToolsBridgeServerSandbox.java
+++ /dev/null
@@ -1,96 +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 android.content.Context;
-import android.os.Process;
-import android.util.Log;
-
-import org.chromium.components.devtools_bridge.util.LooperExecutor;
-
-import java.io.IOException;
-
-/**
- * Sandbox for manual testing {@link DevToolsBridgeServer}
- */
-public class DevToolsBridgeServerSandbox {
- private static final String TAG = "DevToolsBridgeServerSandbox";
- private static final String SERVER_SOCKET_NAME = "chrome_shell_devtools_remote";
-
- private Context mContext;
- private LooperExecutor mExecutor;
- private DevToolsBridgeServer mServer;
- private SessionDependencyFactory mFactory;
- private ClientSessionTestingHost mClientSession1;
- private ClientSessionTestingHost mClientSession2;
-
- public void start(Context context) {
- assert mContext == null;
- mContext = context;
- mExecutor = LooperExecutor.newInstanceForMainLooper(mContext);
- mServer = new DevToolsBridgeServer(new ServerDelegate(context));
-
- mFactory = SessionDependencyFactory.newInstance();
- mClientSession1 = createSession("Session 1", "webview_devtools_remote_" + Process.myPid());
- mClientSession2 = createSession("Session 2", "chrome_devtools_remote_" + Process.myPid());
-
- mClientSession1.start();
- mClientSession2.start();
- }
-
- public void stop() {
- mClientSession1.dispose();
- mClientSession2.dispose();
- mFactory.dispose();
- mClientSession1 = null;
- mClientSession2 = null;
- mFactory = null;
- mServer.dispose();
- mServer = null;
- mContext = null;
- }
-
- private ClientSessionTestingHost createSession(String sessionId, String socketName) {
- try {
- return new ClientSessionTestingHost(
- mFactory, mServer, mExecutor, sessionId, socketName);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void stopInternal() {
- Log.d(TAG, "Service disconnected. Stopping client sessions");
- mClientSession1.dispose();
- mClientSession2.dispose();
- mFactory.dispose();
- mClientSession1 = null;
- mClientSession2 = null;
- mFactory = null;
- }
-
- private static class ServerDelegate implements DevToolsBridgeServer.Delegate {
- private Context mContext;
-
- public ServerDelegate(Context context) {
- mContext = context;
- }
-
- @Override
- public Context getContext() {
- return mContext;
- }
-
- @Override
- public void onSessionCountChange(int sessionCount) {
- Log.i(TAG, sessionCount + " active session");
- }
-
- @Override
- public void querySocketName(DevToolsBridgeServer.QuerySocketCallback callback) {
- callback.onSuccess(SERVER_SOCKET_NAME);
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698