| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 * times. | 47 * times. |
| 48 * | 48 * |
| 49 * @param data to return in response. | 49 * @param data to return in response. |
| 50 * @param dataRepeatCount number of times to repeat the data. | 50 * @param dataRepeatCount number of times to repeat the data. |
| 51 */ | 51 */ |
| 52 public static String getMockUrlForData(String data, int dataRepeatCount) { | 52 public static String getMockUrlForData(String data, int dataRepeatCount) { |
| 53 return nativeGetMockUrlForData(data, dataRepeatCount); | 53 return nativeGetMockUrlForData(data, dataRepeatCount); |
| 54 } | 54 } |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Constructs a mock URL that will request client certificate and return |
| 58 * the string "data" as the response. |
| 59 */ |
| 60 public static String getMockUrlForClientCertificateRequest() { |
| 61 return nativeGetMockUrlForClientCertificateRequest(); |
| 62 } |
| 63 |
| 64 /** |
| 57 * 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. |
| 58 */ | 66 */ |
| 59 public static String getMockUrlForSSLCertificateError() { | 67 public static String getMockUrlForSSLCertificateError() { |
| 60 return nativeGetMockUrlForSSLCertificateError(); | 68 return nativeGetMockUrlForSSLCertificateError(); |
| 61 } | 69 } |
| 62 | 70 |
| 63 private static native void nativeAddUrlInterceptors(); | 71 private static native void nativeAddUrlInterceptors(); |
| 64 | 72 |
| 65 private static native String nativeGetMockUrlWithFailure(int phase, int netE
rror); | 73 private static native String nativeGetMockUrlWithFailure(int phase, int netE
rror); |
| 66 | 74 |
| 67 private static native String nativeGetMockUrlForData(String data, | 75 private static native String nativeGetMockUrlForData(String data, |
| 68 int dataRepeatCount); | 76 int dataRepeatCount); |
| 69 | 77 |
| 78 private static native String nativeGetMockUrlForClientCertificateRequest(); |
| 79 |
| 70 private static native String nativeGetMockUrlForSSLCertificateError(); | 80 private static native String nativeGetMockUrlForSSLCertificateError(); |
| 71 } | 81 } |
| OLD | NEW |