| 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/cert/multi_threaded_cert_verifier.h" | 5 #include "net/cert/multi_threaded_cert_verifier.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 1, | 376 1, |
| 377 }, | 377 }, |
| 378 { // Different additional_trust_anchors. | 378 { // Different additional_trust_anchors. |
| 379 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", | 379 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", |
| 380 0, empty_list), | 380 0, empty_list), |
| 381 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", | 381 MultiThreadedCertVerifier::RequestParams(a_key, a_key, "www.example.test", |
| 382 0, test_list), | 382 0, test_list), |
| 383 -1, | 383 -1, |
| 384 }, | 384 }, |
| 385 }; | 385 }; |
| 386 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 386 for (size_t i = 0; i < arraysize(tests); ++i) { |
| 387 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); | 387 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); |
| 388 | 388 |
| 389 const MultiThreadedCertVerifier::RequestParams& key1 = tests[i].key1; | 389 const MultiThreadedCertVerifier::RequestParams& key1 = tests[i].key1; |
| 390 const MultiThreadedCertVerifier::RequestParams& key2 = tests[i].key2; | 390 const MultiThreadedCertVerifier::RequestParams& key2 = tests[i].key2; |
| 391 | 391 |
| 392 switch (tests[i].expected_result) { | 392 switch (tests[i].expected_result) { |
| 393 case -1: | 393 case -1: |
| 394 EXPECT_TRUE(key1 < key2); | 394 EXPECT_TRUE(key1 < key2); |
| 395 EXPECT_FALSE(key2 < key1); | 395 EXPECT_FALSE(key2 < key1); |
| 396 break; | 396 break; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 Mock::VerifyAndClearExpectations(&trust_provider); | 476 Mock::VerifyAndClearExpectations(&trust_provider); |
| 477 ASSERT_EQ(ERR_IO_PENDING, error); | 477 ASSERT_EQ(ERR_IO_PENDING, error); |
| 478 EXPECT_TRUE(request_handle); | 478 EXPECT_TRUE(request_handle); |
| 479 error = callback.WaitForResult(); | 479 error = callback.WaitForResult(); |
| 480 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error); | 480 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error); |
| 481 ASSERT_EQ(3u, verifier_.requests()); | 481 ASSERT_EQ(3u, verifier_.requests()); |
| 482 ASSERT_EQ(1u, verifier_.cache_hits()); | 482 ASSERT_EQ(1u, verifier_.cache_hits()); |
| 483 } | 483 } |
| 484 | 484 |
| 485 } // namespace net | 485 } // namespace net |
| OLD | NEW |