| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.test.AndroidTestCase; | 7 import android.test.AndroidTestCase; |
| 8 | 8 |
| 9 import org.chromium.base.ContextUtils; | 9 import org.chromium.base.ContextUtils; |
| 10 import org.chromium.base.PathUtils; | 10 import org.chromium.base.PathUtils; |
| 11 import org.chromium.net.impl.CronetEngineBase; | 11 import org.chromium.net.impl.CronetEngineBase; |
| 12 import org.chromium.net.impl.JavaCronetEngine; | 12 import org.chromium.net.impl.JavaCronetEngine; |
| 13 import org.chromium.net.impl.JavaCronetProvider; | 13 import org.chromium.net.impl.JavaCronetProvider; |
| 14 import org.chromium.net.impl.UserAgent; | 14 import org.chromium.net.impl.UserAgent; |
| 15 | 15 |
| 16 import java.lang.annotation.ElementType; | 16 import java.lang.annotation.ElementType; |
| 17 import java.lang.annotation.Retention; | 17 import java.lang.annotation.Retention; |
| 18 import java.lang.annotation.RetentionPolicy; | 18 import java.lang.annotation.RetentionPolicy; |
| 19 import java.lang.annotation.Target; | 19 import java.lang.annotation.Target; |
| 20 import java.lang.reflect.AnnotatedElement; | 20 import java.lang.reflect.AnnotatedElement; |
| 21 import java.net.URL; | 21 import java.net.URL; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Base test class for all CronetTest based tests. | 24 * Base test class for all CronetTest based tests. |
| 25 */ | 25 */ |
| 26 public class CronetTestBase extends AndroidTestCase { | 26 public class CronetTestBase extends AndroidTestCase { |
| 27 /** |
| 28 * Name of the file that contains the test server certificate in PEM format. |
| 29 */ |
| 30 static final String SERVER_CERT_PEM = "quic_test.example.com.crt"; |
| 31 |
| 32 /** |
| 33 * Name of the file that contains the test server private key in PKCS8 PEM f
ormat. |
| 34 */ |
| 35 static final String SERVER_KEY_PKCS8_PEM = "quic_test.example.com.key.pkcs8.
pem"; |
| 36 |
| 27 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "cronet_test"; | 37 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "cronet_test"; |
| 28 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; | 38 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; |
| 29 | 39 |
| 30 private CronetTestFramework mCronetTestFramework; | 40 private CronetTestFramework mCronetTestFramework; |
| 31 // {@code true} when test is being run against system HttpURLConnection impl
ementation. | 41 // {@code true} when test is being run against system HttpURLConnection impl
ementation. |
| 32 private boolean mTestingSystemHttpURLConnection; | 42 private boolean mTestingSystemHttpURLConnection; |
| 33 private boolean mTestingJavaImpl = false; | 43 private boolean mTestingJavaImpl = false; |
| 34 | 44 |
| 35 @Override | 45 @Override |
| 36 protected void setUp() throws Exception { | 46 protected void setUp() throws Exception { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 202 |
| 193 @Target(ElementType.METHOD) | 203 @Target(ElementType.METHOD) |
| 194 @Retention(RetentionPolicy.RUNTIME) | 204 @Retention(RetentionPolicy.RUNTIME) |
| 195 public @interface OnlyRunCronetHttpURLConnection { | 205 public @interface OnlyRunCronetHttpURLConnection { |
| 196 } | 206 } |
| 197 | 207 |
| 198 @Target(ElementType.METHOD) | 208 @Target(ElementType.METHOD) |
| 199 @Retention(RetentionPolicy.RUNTIME) | 209 @Retention(RetentionPolicy.RUNTIME) |
| 200 public @interface OnlyRunNativeCronet {} | 210 public @interface OnlyRunNativeCronet {} |
| 201 } | 211 } |
| OLD | NEW |