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

Unified Diff: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TestGCDClient.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/apiary/TestGCDClient.java
diff --git a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TestGCDClient.java b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TestGCDClient.java
deleted file mode 100644
index 397a2515fcb50d1dd2cf8991adcc3d7385dee5cd..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/apiary/TestGCDClient.java
+++ /dev/null
@@ -1,59 +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.apiary;
-
-import android.util.JsonReader;
-
-import org.apache.http.client.HttpClient;
-
-import org.chromium.components.devtools_bridge.commands.Command;
-import org.chromium.components.devtools_bridge.gcd.RemoteInstance;
-import org.chromium.components.devtools_bridge.gcd.TestMessageReader;
-import org.chromium.components.devtools_bridge.gcd.TestMessageWriter;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * Extension of GCDClient with methods needed for the testing app.
- */
-public class TestGCDClient extends GCDClient {
- private static final String SEND_TIMEOUT_MS = "20000";
-
- TestGCDClient(HttpClient httpClient, String apiKey, String oAuthToken) {
- super(httpClient, apiKey, oAuthToken);
- assert oAuthToken != null;
- }
-
- public List<RemoteInstance> fetchInstances() throws IOException {
- return mHttpClient.execute(
- newHttpGet("/devices"),
- new JsonResponseHandler<List<RemoteInstance>>() {
- @Override
- public List<RemoteInstance> readResponse(JsonReader reader)
- throws IOException {
- return new TestMessageReader(reader).readRemoteInstances();
- }
- });
- }
-
- public void send(String remoteInstanceId, final Command command) throws IOException {
- String query = "expireInMs=" + SEND_TIMEOUT_MS
- + "&responseAwaitMs=" + SEND_TIMEOUT_MS;
-
- String content = new TestMessageWriter().writeCommand(remoteInstanceId, command)
- .close().toString();
-
- mHttpClient.execute(
- newHttpPost("/commands", query, content),
- new JsonResponseHandler<Boolean>() {
- @Override
- public Boolean readResponse(JsonReader reader) throws IOException {
- new TestMessageReader(reader).readCommandResult(command);
- return Boolean.TRUE;
- }
- });
- }
-}

Powered by Google App Engine
This is Rietveld 408576698