OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/multi_threaded_cert_verifier.h" | 5 #include "net/base/multi_threaded_cert_verifier.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // hosts are different validation keys. | 287 // hosts are different validation keys. |
288 MultiThreadedCertVerifier::RequestParams(a_key, a_key, | 288 MultiThreadedCertVerifier::RequestParams(a_key, a_key, |
289 "www1.example.test", 0), | 289 "www1.example.test", 0), |
290 MultiThreadedCertVerifier::RequestParams(a_key, a_key, | 290 MultiThreadedCertVerifier::RequestParams(a_key, a_key, |
291 "www2.example.test", 0), | 291 "www2.example.test", 0), |
292 -1, | 292 -1, |
293 }, | 293 }, |
294 { // The same certificate, chain, and host, but with different flags | 294 { // The same certificate, chain, and host, but with different flags |
295 // are different validation keys. | 295 // are different validation keys. |
296 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", | 296 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", |
297 X509Certificate::VERIFY_EV_CERT), | 297 CertVerifier::VERIFY_EV_CERT), |
298 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", | 298 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", |
299 0), | 299 0), |
300 1, | 300 1, |
301 } | 301 } |
302 }; | 302 }; |
303 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 303 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
304 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); | 304 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); |
305 | 305 |
306 const MultiThreadedCertVerifier::RequestParams& key1 = tests[i].key1; | 306 const MultiThreadedCertVerifier::RequestParams& key1 = tests[i].key1; |
307 const MultiThreadedCertVerifier::RequestParams& key2 = tests[i].key2; | 307 const MultiThreadedCertVerifier::RequestParams& key2 = tests[i].key2; |
(...skipping 11 matching lines...) Expand all Loading... |
319 EXPECT_FALSE(key1 < key2); | 319 EXPECT_FALSE(key1 < key2); |
320 EXPECT_TRUE(key2 < key1); | 320 EXPECT_TRUE(key2 < key1); |
321 break; | 321 break; |
322 default: | 322 default: |
323 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; | 323 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 } // namespace net | 328 } // namespace net |
OLD | NEW |