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

Unified Diff: components/cronet/android/test/mock_cert_verifier.cc

Issue 2043803003: 👔 Reland #2: Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase atop https://codereview.chromium.org/2041723006 Created 4 years, 6 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/mock_cert_verifier.cc
diff --git a/components/cronet/android/test/mock_cert_verifier.cc b/components/cronet/android/test/mock_cert_verifier.cc
index 10089cdf6d275c9d594156a3ace1a48bafb8e9bb..945f5ea2d67e48cbd807c1d1fe9e7a40578fb60e 100644
--- a/components/cronet/android/test/mock_cert_verifier.cc
+++ b/components/cronet/android/test/mock_cert_verifier.cc
@@ -9,6 +9,8 @@
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
+#include "base/android/jni_string.h"
+#include "base/test/test_support_android.h"
#include "crypto/sha2.h"
#include "jni/MockCertVerifier_jni.h"
#include "net/base/net_errors.h"
@@ -49,9 +51,15 @@ static bool CalculatePublicKeySha256(const net::X509Certificate& cert,
} // namespace
-static jlong CreateMockCertVerifier(JNIEnv* env,
- const JavaParamRef<jclass>& jcaller,
- const JavaParamRef<jobjectArray>& jcerts) {
+static jlong CreateMockCertVerifier(
+ JNIEnv* env,
+ const JavaParamRef<jclass>& jcaller,
+ const JavaParamRef<jobjectArray>& jcerts,
+ const JavaParamRef<jstring>& jtest_data_dir) {
+ base::FilePath test_data_dir(
+ base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
+ base::InitAndroidTestPaths(test_data_dir);
+
std::vector<std::string> certs;
base::android::AppendJavaStringArrayToStringVector(env, jcerts, &certs);
net::MockCertVerifier* mock_cert_verifier = new net::MockCertVerifier();

Powered by Google App Engine
This is Rietveld 408576698