Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java

Issue 1389213003: [Cronet] Use Https for Quic Test Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ryancl
Patch Set: Rebased Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..44e82865f9b21fcdf1435192b979410ada457738
--- /dev/null
+++ b/components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java
@@ -0,0 +1,28 @@
+// 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() {}
mef 2015/10/20 20:43:34 Maybe constructor should call nativeCreateMockCert
xunjieli 2015/10/20 20:57:26 I had that initially, but Paul suggested using a s
+
+ /**
+ * 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.
+ */
+ public static long getNativePointer(String[] certs) {
mef 2015/10/20 20:43:34 Given that native cert verifier is not a singleton
xunjieli 2015/10/20 20:57:26 Done. createMockCertVerifier sgtm. Agreed, the get
+ return nativeCreateMockCertVerifier(certs);
+ }
+
+ private static native long nativeCreateMockCertVerifier(String[] certs);
+}

Powered by Google App Engine
This is Rietveld 408576698