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

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: Address Paul's comments 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..124c91dcf948cf2e3845dd401830d52db6a6a457
--- /dev/null
+++ b/components/cronet/android/test/src/org/chromium/net/MockCertVerifier.java
@@ -0,0 +1,34 @@
+// 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} for testing. The native pointer will be
+ * freed when CronetEngine is torn down.
+ */
+@JNINamespace("cronet")
+public class MockCertVerifier {
+ private long mMockCertVerifier = 0;
pauljensen 2015/10/19 18:52:29 can we just replace mMockCertVerifier, MockCertVer
xunjieli 2015/10/19 20:24:15 Done.
+
+ /**
+ * Creates a native net::MockCertVerifier.
+ * @param certs a String array of certs to accept in testing.
+ */
+ public MockCertVerifier(String[] certs) {
+ mMockCertVerifier = nativeCreateMockCertVerifier(certs);
+ }
+
+ /**
+ * Returns the pointer to the native net::MockCertVerifier.
+ */
+ public long getNativePointer() {
+ return mMockCertVerifier;
+ }
+
+ private static native long nativeCreateMockCertVerifier(String[] certs);
+}

Powered by Google App Engine
This is Rietveld 408576698