| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 error = verifier_.Verify(test_cert, "www.example.com", 0, NULL, | 236 error = verifier_.Verify(test_cert, "www.example.com", 0, NULL, |
| 237 &verify_result, callback.callback(), | 237 &verify_result, callback.callback(), |
| 238 &request_handle, BoundNetLog()); | 238 &request_handle, BoundNetLog()); |
| 239 ASSERT_EQ(ERR_IO_PENDING, error); | 239 ASSERT_EQ(ERR_IO_PENDING, error); |
| 240 ASSERT_TRUE(request_handle != NULL); | 240 ASSERT_TRUE(request_handle != NULL); |
| 241 verifier_.CancelRequest(request_handle); | 241 verifier_.CancelRequest(request_handle); |
| 242 // Destroy |verifier| by going out of scope. | 242 // Destroy |verifier| by going out of scope. |
| 243 } | 243 } |
| 244 | 244 |
| 245 TEST_F(MultiThreadedCertVerifierTest, RequestParamsComparators) { | 245 TEST_F(MultiThreadedCertVerifierTest, RequestParamsComparators) { |
| 246 SHA1Fingerprint a_key; | 246 SHA1HashValue a_key; |
| 247 memset(a_key.data, 'a', sizeof(a_key.data)); | 247 memset(a_key.data, 'a', sizeof(a_key.data)); |
| 248 | 248 |
| 249 SHA1Fingerprint z_key; | 249 SHA1HashValue z_key; |
| 250 memset(z_key.data, 'z', sizeof(z_key.data)); | 250 memset(z_key.data, 'z', sizeof(z_key.data)); |
| 251 | 251 |
| 252 struct { | 252 struct { |
| 253 // Keys to test | 253 // Keys to test |
| 254 MultiThreadedCertVerifier::RequestParams key1; | 254 MultiThreadedCertVerifier::RequestParams key1; |
| 255 MultiThreadedCertVerifier::RequestParams key2; | 255 MultiThreadedCertVerifier::RequestParams key2; |
| 256 | 256 |
| 257 // Expectation: | 257 // Expectation: |
| 258 // -1 means key1 is less than key2 | 258 // -1 means key1 is less than key2 |
| 259 // 0 means key1 equals key2 | 259 // 0 means key1 equals key2 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |