| 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 static junit.framework.Assert.assertTrue; | 7 import static junit.framework.Assert.assertTrue; |
| 8 | 8 |
| 9 import org.chromium.base.annotations.JNINamespace; | 9 import org.chromium.base.annotations.JNINamespace; |
| 10 import org.chromium.net.test.FailurePhase; | 10 import org.chromium.net.test.FailurePhase; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return nativeGetMockUrlForClientCertificateRequest(); | 61 return nativeGetMockUrlForClientCertificateRequest(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * Constructs a mock URL that will fail with an SSL certificate error. | 65 * Constructs a mock URL that will fail with an SSL certificate error. |
| 66 */ | 66 */ |
| 67 public static String getMockUrlForSSLCertificateError() { | 67 public static String getMockUrlForSSLCertificateError() { |
| 68 return nativeGetMockUrlForSSLCertificateError(); | 68 return nativeGetMockUrlForSSLCertificateError(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 /** |
| 72 * Constructs a mock URL that will hang when try to connect to the remote. |
| 73 */ |
| 74 public static String getMockUrlForHangingConnect() { |
| 75 return nativeGetMockUrlForHangingConnect(); |
| 76 } |
| 77 |
| 78 /** |
| 79 * Constructs a mock URL that will hang when try to read response body from
the remote. |
| 80 */ |
| 81 public static String getMockUrlForHangingRead() { |
| 82 return nativeGetMockUrlForHangingRead(); |
| 83 } |
| 84 |
| 71 private static native void nativeAddUrlInterceptors(); | 85 private static native void nativeAddUrlInterceptors(); |
| 72 | 86 |
| 73 private static native String nativeGetMockUrlWithFailure(int phase, int netE
rror); | 87 private static native String nativeGetMockUrlWithFailure(int phase, int netE
rror); |
| 74 | 88 |
| 75 private static native String nativeGetMockUrlForData(String data, | 89 private static native String nativeGetMockUrlForData(String data, |
| 76 int dataRepeatCount); | 90 int dataRepeatCount); |
| 77 | 91 |
| 78 private static native String nativeGetMockUrlForClientCertificateRequest(); | 92 private static native String nativeGetMockUrlForClientCertificateRequest(); |
| 79 | 93 |
| 80 private static native String nativeGetMockUrlForSSLCertificateError(); | 94 private static native String nativeGetMockUrlForSSLCertificateError(); |
| 95 |
| 96 private static native String nativeGetMockUrlForHangingConnect(); |
| 97 |
| 98 private static native String nativeGetMockUrlForHangingRead(); |
| 81 } | 99 } |
| OLD | NEW |