| 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/ssl/default_server_bound_cert_store.h" | 5 #include "net/ssl/default_server_bound_cert_store.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 void CallCounter(int* counter) { | 23 void CallCounter(int* counter) { |
| 24 (*counter)++; | 24 (*counter)++; |
| 25 } | 25 } |
| 26 | 26 |
| 27 void NotCalled() { | |
| 28 ADD_FAILURE() << "Unexpected callback execution."; | |
| 29 } | |
| 30 | |
| 31 void GetCertCallbackNotCalled(int err, | 27 void GetCertCallbackNotCalled(int err, |
| 32 const std::string& server_identifier, | 28 const std::string& server_identifier, |
| 33 base::Time expiration_time, | 29 base::Time expiration_time, |
| 34 const std::string& private_key_result, | 30 const std::string& private_key_result, |
| 35 const std::string& cert_result) { | 31 const std::string& cert_result) { |
| 36 ADD_FAILURE() << "Unexpected callback execution."; | 32 ADD_FAILURE() << "Unexpected callback execution."; |
| 37 } | 33 } |
| 38 | 34 |
| 39 class AsyncGetCertHelper { | 35 class AsyncGetCertHelper { |
| 40 public: | 36 public: |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 ++cert; | 546 ++cert; |
| 551 EXPECT_EQ("copied.com", cert->server_identifier()); | 547 EXPECT_EQ("copied.com", cert->server_identifier()); |
| 552 EXPECT_EQ("g", cert->private_key()); | 548 EXPECT_EQ("g", cert->private_key()); |
| 553 | 549 |
| 554 ++cert; | 550 ++cert; |
| 555 EXPECT_EQ("preexisting.com", cert->server_identifier()); | 551 EXPECT_EQ("preexisting.com", cert->server_identifier()); |
| 556 EXPECT_EQ("a", cert->private_key()); | 552 EXPECT_EQ("a", cert->private_key()); |
| 557 } | 553 } |
| 558 | 554 |
| 559 } // namespace net | 555 } // namespace net |
| OLD | NEW |