OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.net; |
| 6 |
| 7 import android.content.Context; |
| 8 |
| 9 import org.chromium.base.JNINamespace; |
| 10 |
| 11 /** |
| 12 * Wrapper class to start a Quic test server. |
| 13 */ |
| 14 @JNINamespace("cronet") |
| 15 public final class QuicTestServer { |
| 16 public static void startQuicTestServer(Context context) { |
| 17 nativeStartQuicTestServer(TestFilesInstaller.getInstalledPath(context)); |
| 18 } |
| 19 |
| 20 public static void shutdownQuicTestServer() { |
| 21 nativeShutdownQuicTestServer(); |
| 22 } |
| 23 |
| 24 public static String getServerURL() { |
| 25 return "http://" + getServerHost() + ":" + getServerPort(); |
| 26 } |
| 27 |
| 28 public static String getServerHost() { |
| 29 return nativeGetServerHost(); |
| 30 } |
| 31 |
| 32 public static int getServerPort() { |
| 33 return nativeGetServerPort(); |
| 34 } |
| 35 |
| 36 private static native void nativeStartQuicTestServer(String filePath); |
| 37 private static native void nativeShutdownQuicTestServer(); |
| 38 private static native String nativeGetServerHost(); |
| 39 private static native int nativeGetServerPort(); |
| 40 } |
OLD | NEW |