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.ContextUtils; | |
| 10 import org.chromium.base.Log; | 11 import org.chromium.base.Log; |
| 11 import org.chromium.base.annotations.CalledByNative; | 12 import org.chromium.base.annotations.CalledByNative; |
| 12 import org.chromium.base.annotations.JNINamespace; | 13 import org.chromium.base.annotations.JNINamespace; |
| 13 import org.chromium.base.test.util.UrlUtils; | 14 import org.chromium.base.test.util.UrlUtils; |
| 14 | 15 |
| 15 /** | 16 /** |
| 16 * Wrapper class to start a Quic test server. | 17 * Wrapper class to start a Quic test server. |
| 17 */ | 18 */ |
| 18 @JNINamespace("cronet") | 19 @JNINamespace("cronet") |
| 19 public final class QuicTestServer { | 20 public final class QuicTestServer { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 67 |
| 67 public static final String getServerCert() { | 68 public static final String getServerCert() { |
| 68 return CERT_USED; | 69 return CERT_USED; |
| 69 } | 70 } |
| 70 | 71 |
| 71 public static final String getServerCertKey() { | 72 public static final String getServerCertKey() { |
| 72 return KEY_USED; | 73 return KEY_USED; |
| 73 } | 74 } |
| 74 | 75 |
| 75 public static long createMockCertVerifier() { | 76 public static long createMockCertVerifier() { |
| 77 TestFilesInstaller.installIfNeeded(ContextUtils.getApplicationContext()) ; | |
|
xunjieli
2016/12/12 19:37:21
startQuicTestServer() already calls installIfNeede
pauljensen
2016/12/12 19:52:42
No, this a public API with no documented or enforc
| |
| 76 return MockCertVerifier.createMockCertVerifier(CERTS_USED, true); | 78 return MockCertVerifier.createMockCertVerifier(CERTS_USED, true); |
| 77 } | 79 } |
| 78 | 80 |
| 79 @CalledByNative | 81 @CalledByNative |
| 80 private static void onServerStarted() { | 82 private static void onServerStarted() { |
| 81 Log.i(TAG, "Quic server started."); | 83 Log.i(TAG, "Quic server started."); |
| 82 sBlock.open(); | 84 sBlock.open(); |
| 83 } | 85 } |
| 84 | 86 |
| 85 private static native void nativeStartQuicTestServer(String filePath, String testDataDir); | 87 private static native void nativeStartQuicTestServer(String filePath, String testDataDir); |
| 86 private static native void nativeShutdownQuicTestServer(); | 88 private static native void nativeShutdownQuicTestServer(); |
| 87 private static native int nativeGetServerPort(); | 89 private static native int nativeGetServerPort(); |
| 88 } | 90 } |
| OLD | NEW |