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 org.chromium.base.annotations.JNINamespace; | 7 import org.chromium.base.annotations.JNINamespace; |
8 import org.chromium.base.test.util.UrlUtils; | |
9 | 8 |
10 /** | 9 /** |
11 * A Java wrapper to supply a net::MockCertVerifier which can be then passed | 10 * A Java wrapper to supply a net::MockCertVerifier which can be then passed |
12 * into {@link CronetEngine.Builder#setMockCertVerifierForTesting}. | 11 * into {@link CronetEngine.Builder#setMockCertVerifierForTesting}. |
13 * The native pointer will be freed when the CronetEngine is torn down. | 12 * The native pointer will be freed when the CronetEngine is torn down. |
14 */ | 13 */ |
15 @JNINamespace("cronet") | 14 @JNINamespace("cronet") |
16 public class MockCertVerifier { | 15 public class MockCertVerifier { |
17 private MockCertVerifier() {} | 16 private MockCertVerifier() {} |
18 | 17 |
19 /** | 18 /** |
20 * Creates a new net::MockCertVerifier, and returns a pointer to it. | 19 * Creates a new net::MockCertVerifier, and returns a pointer to it. |
21 * @param certs a String array of certificate filenames in | 20 * @param certs a String array of certificate filenames in |
22 * net::GetTestCertsDirectory() to accept in testing. | 21 * net::GetTestCertsDirectory() to accept in testing. |
23 * @return a pointer to the newly created net::MockCertVerifier. | 22 * @return a pointer to the newly created net::MockCertVerifier. |
24 */ | 23 */ |
25 public static long createMockCertVerifier(String[] certs) { | 24 public static long createMockCertVerifier(String[] certs) { |
26 return nativeCreateMockCertVerifier(certs, UrlUtils.getIsolatedTestRoot(
)); | 25 return nativeCreateMockCertVerifier(certs); |
27 } | 26 } |
28 | 27 |
29 private static native long nativeCreateMockCertVerifier(String[] certs, Stri
ng testDataDir); | 28 private static native long nativeCreateMockCertVerifier(String[] certs); |
30 } | 29 } |
OLD | NEW |