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

Unified Diff: components/cronet/android/test/src/org/chromium/net/QuicTestServer.java

Issue 1039693003: [Cronet] Add support to run quic_simple_server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use constants Created 5 years, 9 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/cronet/android/test/src/org/chromium/net/QuicTestServer.java
diff --git a/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java b/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
new file mode 100644
index 0000000000000000000000000000000000000000..b29915601d6a7183a7283b5abc05788d91568866
--- /dev/null
+++ b/components/cronet/android/test/src/org/chromium/net/QuicTestServer.java
@@ -0,0 +1,40 @@
+// Copyright 2015 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.net;
+
+import android.content.Context;
+
+import org.chromium.base.JNINamespace;
+
+/**
+ * Wrapper class to start a Quic test server.
+ */
+@JNINamespace("cronet")
+public final class QuicTestServer {
+ public static void startQuicTestServer(Context context) {
+ nativeStartQuicTestServer(TestFilesInstaller.getInstalledPath(context));
+ }
+
+ public static void shutdownQuicTestServer() {
+ nativeShutdownQuicTestServer();
+ }
+
+ public static String getServerURL() {
+ return "http://" + getServerHost() + ":" + getServerPort();
+ }
+
+ public static String getServerHost() {
+ return nativeGetServerHost();
+ }
+
+ public static int getServerPort() {
+ return nativeGetServerPort();
+ }
+
+ private static native void nativeStartQuicTestServer(String filePath);
+ private static native void nativeShutdownQuicTestServer();
+ private static native String nativeGetServerHost();
+ private static native int nativeGetServerPort();
+}

Powered by Google App Engine
This is Rietveld 408576698