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

Side by Side Diff: components/cronet/android/test/mock_cert_verifier.cc

Issue 2090463002: Move net/base/test_data_directory.[cc,h] to net/test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
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 #include "mock_cert_verifier.h" 5 #include "mock_cert_verifier.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/android/jni_array.h" 11 #include "base/android/jni_array.h"
12 #include "base/android/jni_string.h" 12 #include "base/android/jni_string.h"
13 #include "base/test/test_support_android.h" 13 #include "base/test/test_support_android.h"
14 #include "crypto/sha2.h" 14 #include "crypto/sha2.h"
15 #include "jni/MockCertVerifier_jni.h" 15 #include "jni/MockCertVerifier_jni.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "net/base/test_data_directory.h"
18 #include "net/cert/asn1_util.h" 17 #include "net/cert/asn1_util.h"
19 #include "net/cert/cert_verifier.h" 18 #include "net/cert/cert_verifier.h"
20 #include "net/cert/cert_verify_result.h" 19 #include "net/cert/cert_verify_result.h"
21 #include "net/cert/mock_cert_verifier.h" 20 #include "net/cert/mock_cert_verifier.h"
22 #include "net/test/cert_test_util.h" 21 #include "net/test/cert_test_util.h"
22 #include "net/test/test_data_directory.h"
23 23
24 namespace cronet { 24 namespace cronet {
25 25
26 namespace { 26 namespace {
27 27
28 // Populates |out_hash_value| with the SHA256 hash of the |cert| public key. 28 // Populates |out_hash_value| with the SHA256 hash of the |cert| public key.
29 // Returns true on success. 29 // Returns true on success.
30 static bool CalculatePublicKeySha256(const net::X509Certificate& cert, 30 static bool CalculatePublicKeySha256(const net::X509Certificate& cert,
31 net::HashValue* out_hash_value) { 31 net::HashValue* out_hash_value) {
32 // Convert the cert to DER encoded bytes. 32 // Convert the cert to DER encoded bytes.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 return reinterpret_cast<jlong>(mock_cert_verifier); 85 return reinterpret_cast<jlong>(mock_cert_verifier);
86 } 86 }
87 87
88 bool RegisterMockCertVerifier(JNIEnv* env) { 88 bool RegisterMockCertVerifier(JNIEnv* env) {
89 return RegisterNativesImpl(env); 89 return RegisterNativesImpl(env);
90 } 90 }
91 91
92 } // namespace cronet 92 } // namespace cronet
OLDNEW
« no previous file with comments | « components/certificate_reporting/error_report_unittest.cc ('k') | components/cronet/android/test/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698