| 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.ContextUtils; |
| 11 import org.chromium.base.Log; | 11 import org.chromium.base.Log; |
| 12 import org.chromium.base.annotations.CalledByNative; | 12 import org.chromium.base.annotations.CalledByNative; |
| 13 import org.chromium.base.annotations.JNINamespace; | 13 import org.chromium.base.annotations.JNINamespace; |
| 14 import org.chromium.base.test.util.UrlUtils; | 14 import org.chromium.base.test.util.UrlUtils; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Wrapper class to start a Quic test server. | 17 * Wrapper class to start a Quic test server. |
| 18 */ | 18 */ |
| 19 @JNINamespace("cronet") | 19 @JNINamespace("cronet") |
| 20 public final class QuicTestServer { | 20 public final class QuicTestServer { |
| 21 private static final ConditionVariable sBlock = new ConditionVariable(); | 21 private static final ConditionVariable sBlock = new ConditionVariable(); |
| 22 private static final String TAG = "cr.QuicTestServer"; | 22 private static final String TAG = QuicTestServer.class.getSimpleName(); |
| 23 | 23 |
| 24 private static final String CERT_USED = "quic_test.example.com.crt"; | 24 private static final String CERT_USED = "quic_test.example.com.crt"; |
| 25 private static final String KEY_USED = "quic_test.example.com.key"; | 25 private static final String KEY_USED = "quic_test.example.com.key"; |
| 26 private static final String[] CERTS_USED = {CERT_USED}; | 26 private static final String[] CERTS_USED = {CERT_USED}; |
| 27 | 27 |
| 28 private static boolean sServerRunning = false; | 28 private static boolean sServerRunning = false; |
| 29 | 29 |
| 30 /* | 30 /* |
| 31 * Starts the server. | 31 * Starts the server. |
| 32 */ | 32 */ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 @CalledByNative | 81 @CalledByNative |
| 82 private static void onServerStarted() { | 82 private static void onServerStarted() { |
| 83 Log.i(TAG, "Quic server started."); | 83 Log.i(TAG, "Quic server started."); |
| 84 sBlock.open(); | 84 sBlock.open(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 private static native void nativeStartQuicTestServer(String filePath, String
testDataDir); | 87 private static native void nativeStartQuicTestServer(String filePath, String
testDataDir); |
| 88 private static native void nativeShutdownQuicTestServer(); | 88 private static native void nativeShutdownQuicTestServer(); |
| 89 private static native int nativeGetServerPort(); | 89 private static native int nativeGetServerPort(); |
| 90 } | 90 } |
| OLD | NEW |