Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.ConditionVariable; | 8 import android.os.ConditionVariable; |
| 9 | 9 |
| 10 import org.chromium.base.Log; | 10 import org.chromium.base.Log; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 } | 50 } |
| 51 nativeShutdownQuicTestServer(); | 51 nativeShutdownQuicTestServer(); |
| 52 sServerRunning = false; | 52 sServerRunning = false; |
| 53 } | 53 } |
| 54 | 54 |
| 55 public static String getServerURL() { | 55 public static String getServerURL() { |
| 56 return "https://" + getServerHost() + ":" + getServerPort(); | 56 return "https://" + getServerHost() + ":" + getServerPort(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 public static String getServerHost() { | 59 public static String getServerHost() { |
| 60 return nativeGetServerHost(); | 60 return CronetTestUtil.QUIC_FAKE_HOST; |
|
pauljensen
2016/07/26 18:18:52
ditto
| |
| 61 } | 61 } |
| 62 | 62 |
| 63 public static int getServerPort() { | 63 public static int getServerPort() { |
| 64 return nativeGetServerPort(); | 64 return nativeGetServerPort(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 public static final String getServerCert() { | 67 public static final String getServerCert() { |
| 68 return CERT_USED; | 68 return CERT_USED; |
| 69 } | 69 } |
| 70 | 70 |
| 71 public static final String getServerCertKey() { | 71 public static final String getServerCertKey() { |
| 72 return KEY_USED; | 72 return KEY_USED; |
| 73 } | 73 } |
| 74 | 74 |
| 75 public static long createMockCertVerifier() { | 75 public static long createMockCertVerifier() { |
| 76 return MockCertVerifier.createMockCertVerifier(CERTS_USED, true); | 76 return MockCertVerifier.createMockCertVerifier(CERTS_USED, true); |
| 77 } | 77 } |
| 78 | 78 |
| 79 @CalledByNative | 79 @CalledByNative |
| 80 private static void onServerStarted() { | 80 private static void onServerStarted() { |
| 81 Log.i(TAG, "Quic server started."); | 81 Log.i(TAG, "Quic server started."); |
| 82 sBlock.open(); | 82 sBlock.open(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private static native void nativeStartQuicTestServer(String filePath, String testDataDir); | 85 private static native void nativeStartQuicTestServer(String filePath, String testDataDir); |
| 86 private static native void nativeShutdownQuicTestServer(); | 86 private static native void nativeShutdownQuicTestServer(); |
| 87 private static native String nativeGetServerHost(); | |
| 88 private static native int nativeGetServerPort(); | 87 private static native int nativeGetServerPort(); |
| 89 } | 88 } |
| OLD | NEW |