| Index: components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java
|
| diff --git a/components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java b/components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..bf20bc0f727b806b24e45efeb2d2d7fae6cadf29
|
| --- /dev/null
|
| +++ b/components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.net;
|
| +
|
| +import org.chromium.base.annotations.JNINamespace;
|
| +
|
| +/**
|
| + * A Java wrapper to supply a net::MockCertVerifier which can be then passed
|
| + * into {@link CronetEngine.Builder#setMockCertVerifierForTesting}.
|
| + * The native pointer will be freed when the CronetEngine is torn down.
|
| + */
|
| +@JNINamespace("cronet")
|
| +public class MockCertVerifier {
|
| + private MockCertVerifier() {}
|
| +
|
| + /**
|
| + * Creates a new net::MockCertVerifier, and returns a pointer to it.
|
| + * @param certs a String array of certificate filenames in
|
| + * net::GetTestCertsDirectory() to accept in testing.
|
| + * @return a pointer to the newly created net::MockCertVerifier.
|
| + */
|
| + public static long createMockCertVerifier(String[] certs) {
|
| + return nativeCreateMockCertVerifier(certs);
|
| + }
|
| +
|
| + private static native long nativeCreateMockCertVerifier(String[] certs);
|
| +}
|
|
|