| Index: net/ssl/default_channel_id_store_unittest.cc
|
| diff --git a/net/ssl/default_server_bound_cert_store_unittest.cc b/net/ssl/default_channel_id_store_unittest.cc
|
| similarity index 71%
|
| rename from net/ssl/default_server_bound_cert_store_unittest.cc
|
| rename to net/ssl/default_channel_id_store_unittest.cc
|
| index a742e0c3f1cf4a697ed1e2d805fd6516273b965d..f0aea571c3fdb68d0e67c44c0f50a2d74793746f 100644
|
| --- a/net/ssl/default_server_bound_cert_store_unittest.cc
|
| +++ b/net/ssl/default_channel_id_store_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "net/ssl/default_server_bound_cert_store.h"
|
| +#include "net/ssl/default_channel_id_store.h"
|
|
|
| #include <map>
|
| #include <string>
|
| @@ -58,57 +58,57 @@ class AsyncGetCertHelper {
|
| };
|
|
|
| void GetAllCallback(
|
| - ServerBoundCertStore::ServerBoundCertList* dest,
|
| - const ServerBoundCertStore::ServerBoundCertList& result) {
|
| + ChannelIDStore::ChannelIDList* dest,
|
| + const ChannelIDStore::ChannelIDList& result) {
|
| *dest = result;
|
| }
|
|
|
| class MockPersistentStore
|
| - : public DefaultServerBoundCertStore::PersistentStore {
|
| + : public DefaultChannelIDStore::PersistentStore {
|
| public:
|
| MockPersistentStore();
|
|
|
| - // DefaultServerBoundCertStore::PersistentStore implementation.
|
| + // DefaultChannelIDStore::PersistentStore implementation.
|
| virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE;
|
| - virtual void AddServerBoundCert(
|
| - const DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE;
|
| - virtual void DeleteServerBoundCert(
|
| - const DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE;
|
| + virtual void AddChannelID(
|
| + const DefaultChannelIDStore::ChannelID& cert) OVERRIDE;
|
| + virtual void DeleteChannelID(
|
| + const DefaultChannelIDStore::ChannelID& cert) OVERRIDE;
|
| virtual void SetForceKeepSessionState() OVERRIDE;
|
|
|
| protected:
|
| virtual ~MockPersistentStore();
|
|
|
| private:
|
| - typedef std::map<std::string, DefaultServerBoundCertStore::ServerBoundCert>
|
| - ServerBoundCertMap;
|
| + typedef std::map<std::string, DefaultChannelIDStore::ChannelID>
|
| + ChannelIDMap;
|
|
|
| - ServerBoundCertMap origin_certs_;
|
| + ChannelIDMap origin_certs_;
|
| };
|
|
|
| MockPersistentStore::MockPersistentStore() {}
|
|
|
| void MockPersistentStore::Load(const LoadedCallback& loaded_callback) {
|
| - scoped_ptr<ScopedVector<DefaultServerBoundCertStore::ServerBoundCert> >
|
| - certs(new ScopedVector<DefaultServerBoundCertStore::ServerBoundCert>());
|
| - ServerBoundCertMap::iterator it;
|
| + scoped_ptr<ScopedVector<DefaultChannelIDStore::ChannelID> >
|
| + certs(new ScopedVector<DefaultChannelIDStore::ChannelID>());
|
| + ChannelIDMap::iterator it;
|
|
|
| for (it = origin_certs_.begin(); it != origin_certs_.end(); ++it) {
|
| certs->push_back(
|
| - new DefaultServerBoundCertStore::ServerBoundCert(it->second));
|
| + new DefaultChannelIDStore::ChannelID(it->second));
|
| }
|
|
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE, base::Bind(loaded_callback, base::Passed(&certs)));
|
| }
|
|
|
| -void MockPersistentStore::AddServerBoundCert(
|
| - const DefaultServerBoundCertStore::ServerBoundCert& cert) {
|
| +void MockPersistentStore::AddChannelID(
|
| + const DefaultChannelIDStore::ChannelID& cert) {
|
| origin_certs_[cert.server_identifier()] = cert;
|
| }
|
|
|
| -void MockPersistentStore::DeleteServerBoundCert(
|
| - const DefaultServerBoundCertStore::ServerBoundCert& cert) {
|
| +void MockPersistentStore::DeleteChannelID(
|
| + const DefaultChannelIDStore::ChannelID& cert) {
|
| origin_certs_.erase(cert.server_identifier());
|
| }
|
|
|
| @@ -118,27 +118,27 @@ MockPersistentStore::~MockPersistentStore() {}
|
|
|
| } // namespace
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestLoading) {
|
| +TEST(DefaultChannelIDStoreTest, TestLoading) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
|
|
| - persistent_store->AddServerBoundCert(
|
| - DefaultServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(
|
| + DefaultChannelIDStore::ChannelID(
|
| "google.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b"));
|
| - persistent_store->AddServerBoundCert(
|
| - DefaultServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(
|
| + DefaultChannelIDStore::ChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| "c", "d"));
|
|
|
| // Make sure certs load properly.
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
| // Load has not occurred yet.
|
| EXPECT_EQ(0, store.GetCertCount());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -146,7 +146,7 @@ TEST(DefaultServerBoundCertStoreTest, TestLoading) {
|
| // Wait for load & queued set task.
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_EQ(2, store.GetCertCount());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "twitter.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -156,27 +156,27 @@ TEST(DefaultServerBoundCertStoreTest, TestLoading) {
|
| }
|
|
|
| //TODO(mattm): add more tests of without a persistent store?
|
| -TEST(DefaultServerBoundCertStoreTest, TestSettingAndGetting) {
|
| +TEST(DefaultChannelIDStoreTest, TestSettingAndGetting) {
|
| // No persistent store, all calls will be synchronous.
|
| - DefaultServerBoundCertStore store(NULL);
|
| + DefaultChannelIDStore store(NULL);
|
| base::Time expiration_time;
|
| std::string private_key, cert;
|
| EXPECT_EQ(0, store.GetCertCount());
|
| EXPECT_EQ(ERR_FILE_NOT_FOUND,
|
| - store.GetServerBoundCert("verisign.com",
|
| + store.GetChannelID("verisign.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| base::Bind(&GetCertCallbackNotCalled)));
|
| EXPECT_TRUE(private_key.empty());
|
| EXPECT_TRUE(cert.empty());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time::FromInternalValue(123),
|
| base::Time::FromInternalValue(456),
|
| "i", "j");
|
| EXPECT_EQ(OK,
|
| - store.GetServerBoundCert("verisign.com",
|
| + store.GetChannelID("verisign.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| @@ -186,19 +186,19 @@ TEST(DefaultServerBoundCertStoreTest, TestSettingAndGetting) {
|
| EXPECT_EQ("j", cert);
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestDuplicateCerts) {
|
| +TEST(DefaultChannelIDStoreTest, TestDuplicateCerts) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| base::Time expiration_time;
|
| std::string private_key, cert;
|
| EXPECT_EQ(0, store.GetCertCount());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time::FromInternalValue(123),
|
| base::Time::FromInternalValue(1234),
|
| "a", "b");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time::FromInternalValue(456),
|
| base::Time::FromInternalValue(4567),
|
| @@ -208,7 +208,7 @@ TEST(DefaultServerBoundCertStoreTest, TestDuplicateCerts) {
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_EQ(1, store.GetCertCount());
|
| EXPECT_EQ(OK,
|
| - store.GetServerBoundCert("verisign.com",
|
| + store.GetChannelID("verisign.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| @@ -218,22 +218,22 @@ TEST(DefaultServerBoundCertStoreTest, TestDuplicateCerts) {
|
| EXPECT_EQ("d", cert);
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestAsyncGet) {
|
| +TEST(DefaultChannelIDStoreTest, TestAsyncGet) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "verisign.com",
|
| base::Time::FromInternalValue(123),
|
| base::Time::FromInternalValue(1234),
|
| "a", "b"));
|
|
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
| AsyncGetCertHelper helper;
|
| base::Time expiration_time;
|
| std::string private_key;
|
| std::string cert = "not set";
|
| EXPECT_EQ(0, store.GetCertCount());
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - store.GetServerBoundCert("verisign.com",
|
| + store.GetChannelID("verisign.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| @@ -252,21 +252,21 @@ TEST(DefaultServerBoundCertStoreTest, TestAsyncGet) {
|
| EXPECT_EQ("b", helper.cert_);
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestDeleteAll) {
|
| +TEST(DefaultChannelIDStoreTest, TestDeleteAll) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "google.com",
|
| base::Time(),
|
| base::Time(),
|
| "c", "d");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "harvard.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -281,27 +281,27 @@ TEST(DefaultServerBoundCertStoreTest, TestDeleteAll) {
|
| EXPECT_EQ(0, store.GetCertCount());
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestAsyncGetAndDeleteAll) {
|
| +TEST(DefaultChannelIDStoreTest, TestAsyncGetAndDeleteAll) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b"));
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "google.com",
|
| base::Time(),
|
| base::Time(),
|
| "c", "d"));
|
|
|
| - ServerBoundCertStore::ServerBoundCertList pre_certs;
|
| - ServerBoundCertStore::ServerBoundCertList post_certs;
|
| + ChannelIDStore::ChannelIDList pre_certs;
|
| + ChannelIDStore::ChannelIDList post_certs;
|
| int delete_finished = 0;
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| - store.GetAllServerBoundCerts(base::Bind(GetAllCallback, &pre_certs));
|
| + store.GetAllChannelIDs(base::Bind(GetAllCallback, &pre_certs));
|
| store.DeleteAll(base::Bind(&CallCounter, &delete_finished));
|
| - store.GetAllServerBoundCerts(base::Bind(GetAllCallback, &post_certs));
|
| + store.GetAllChannelIDs(base::Bind(GetAllCallback, &post_certs));
|
| // Tasks have not run yet.
|
| EXPECT_EQ(0u, pre_certs.size());
|
| // Wait for load & queued tasks.
|
| @@ -311,14 +311,14 @@ TEST(DefaultServerBoundCertStoreTest, TestAsyncGetAndDeleteAll) {
|
| EXPECT_EQ(0u, post_certs.size());
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestDelete) {
|
| +TEST(DefaultChannelIDStoreTest, TestDelete) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| base::Time expiration_time;
|
| std::string private_key, cert;
|
| EXPECT_EQ(0, store.GetCertCount());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -326,7 +326,7 @@ TEST(DefaultServerBoundCertStoreTest, TestDelete) {
|
| // Wait for load & queued set task.
|
| base::MessageLoop::current()->RunUntilIdle();
|
|
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "google.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -334,50 +334,50 @@ TEST(DefaultServerBoundCertStoreTest, TestDelete) {
|
|
|
| EXPECT_EQ(2, store.GetCertCount());
|
| int delete_finished = 0;
|
| - store.DeleteServerBoundCert("verisign.com",
|
| + store.DeleteChannelID("verisign.com",
|
| base::Bind(&CallCounter, &delete_finished));
|
| ASSERT_EQ(1, delete_finished);
|
| EXPECT_EQ(1, store.GetCertCount());
|
| EXPECT_EQ(ERR_FILE_NOT_FOUND,
|
| - store.GetServerBoundCert("verisign.com",
|
| + store.GetChannelID("verisign.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| base::Bind(&GetCertCallbackNotCalled)));
|
| EXPECT_EQ(OK,
|
| - store.GetServerBoundCert("google.com",
|
| + store.GetChannelID("google.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| base::Bind(&GetCertCallbackNotCalled)));
|
| int delete2_finished = 0;
|
| - store.DeleteServerBoundCert("google.com",
|
| + store.DeleteChannelID("google.com",
|
| base::Bind(&CallCounter, &delete2_finished));
|
| ASSERT_EQ(1, delete2_finished);
|
| EXPECT_EQ(0, store.GetCertCount());
|
| EXPECT_EQ(ERR_FILE_NOT_FOUND,
|
| - store.GetServerBoundCert("google.com",
|
| + store.GetChannelID("google.com",
|
| &expiration_time,
|
| &private_key,
|
| &cert,
|
| base::Bind(&GetCertCallbackNotCalled)));
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestAsyncDelete) {
|
| +TEST(DefaultChannelIDStoreTest, TestAsyncDelete) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "a.com",
|
| base::Time::FromInternalValue(1),
|
| base::Time::FromInternalValue(2),
|
| "a", "b"));
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "b.com",
|
| base::Time::FromInternalValue(3),
|
| base::Time::FromInternalValue(4),
|
| "c", "d"));
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
| int delete_finished = 0;
|
| - store.DeleteServerBoundCert("a.com",
|
| + store.DeleteChannelID("a.com",
|
| base::Bind(&CallCounter, &delete_finished));
|
|
|
| AsyncGetCertHelper a_helper;
|
| @@ -387,12 +387,12 @@ TEST(DefaultServerBoundCertStoreTest, TestAsyncDelete) {
|
| std::string cert = "not set";
|
| EXPECT_EQ(0, store.GetCertCount());
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - store.GetServerBoundCert(
|
| + store.GetChannelID(
|
| "a.com", &expiration_time, &private_key, &cert,
|
| base::Bind(&AsyncGetCertHelper::Callback,
|
| base::Unretained(&a_helper))));
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - store.GetServerBoundCert(
|
| + store.GetChannelID(
|
| "b.com", &expiration_time, &private_key, &cert,
|
| base::Bind(&AsyncGetCertHelper::Callback,
|
| base::Unretained(&b_helper))));
|
| @@ -419,27 +419,27 @@ TEST(DefaultServerBoundCertStoreTest, TestAsyncDelete) {
|
| EXPECT_EQ("d", b_helper.cert_);
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestGetAll) {
|
| +TEST(DefaultChannelIDStoreTest, TestGetAll) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| EXPECT_EQ(0, store.GetCertCount());
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "verisign.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "google.com",
|
| base::Time(),
|
| base::Time(),
|
| "c", "d");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "harvard.com",
|
| base::Time(),
|
| base::Time(),
|
| "e", "f");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "mit.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -448,21 +448,21 @@ TEST(DefaultServerBoundCertStoreTest, TestGetAll) {
|
| base::MessageLoop::current()->RunUntilIdle();
|
|
|
| EXPECT_EQ(4, store.GetCertCount());
|
| - ServerBoundCertStore::ServerBoundCertList certs;
|
| - store.GetAllServerBoundCerts(base::Bind(GetAllCallback, &certs));
|
| + ChannelIDStore::ChannelIDList certs;
|
| + store.GetAllChannelIDs(base::Bind(GetAllCallback, &certs));
|
| EXPECT_EQ(4u, certs.size());
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestInitializeFrom) {
|
| +TEST(DefaultChannelIDStoreTest, TestInitializeFrom) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| + DefaultChannelIDStore store(persistent_store.get());
|
|
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "preexisting.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b");
|
| - store.SetServerBoundCert(
|
| + store.SetChannelID(
|
| "both.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -471,14 +471,14 @@ TEST(DefaultServerBoundCertStoreTest, TestInitializeFrom) {
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_EQ(2, store.GetCertCount());
|
|
|
| - ServerBoundCertStore::ServerBoundCertList source_certs;
|
| - source_certs.push_back(ServerBoundCertStore::ServerBoundCert(
|
| + ChannelIDStore::ChannelIDList source_certs;
|
| + source_certs.push_back(ChannelIDStore::ChannelID(
|
| "both.com",
|
| base::Time(),
|
| base::Time(),
|
| // Key differs from above to test that existing entries are overwritten.
|
| "e", "f"));
|
| - source_certs.push_back(ServerBoundCertStore::ServerBoundCert(
|
| + source_certs.push_back(ChannelIDStore::ChannelID(
|
| "copied.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -486,11 +486,11 @@ TEST(DefaultServerBoundCertStoreTest, TestInitializeFrom) {
|
| store.InitializeFrom(source_certs);
|
| EXPECT_EQ(3, store.GetCertCount());
|
|
|
| - ServerBoundCertStore::ServerBoundCertList certs;
|
| - store.GetAllServerBoundCerts(base::Bind(GetAllCallback, &certs));
|
| + ChannelIDStore::ChannelIDList certs;
|
| + store.GetAllChannelIDs(base::Bind(GetAllCallback, &certs));
|
| ASSERT_EQ(3u, certs.size());
|
|
|
| - ServerBoundCertStore::ServerBoundCertList::iterator cert = certs.begin();
|
| + ChannelIDStore::ChannelIDList::iterator cert = certs.begin();
|
| EXPECT_EQ("both.com", cert->server_identifier());
|
| EXPECT_EQ("e", cert->private_key());
|
|
|
| @@ -503,28 +503,28 @@ TEST(DefaultServerBoundCertStoreTest, TestInitializeFrom) {
|
| EXPECT_EQ("a", cert->private_key());
|
| }
|
|
|
| -TEST(DefaultServerBoundCertStoreTest, TestAsyncInitializeFrom) {
|
| +TEST(DefaultChannelIDStoreTest, TestAsyncInitializeFrom) {
|
| scoped_refptr<MockPersistentStore> persistent_store(new MockPersistentStore);
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "preexisting.com",
|
| base::Time(),
|
| base::Time(),
|
| "a", "b"));
|
| - persistent_store->AddServerBoundCert(ServerBoundCertStore::ServerBoundCert(
|
| + persistent_store->AddChannelID(ChannelIDStore::ChannelID(
|
| "both.com",
|
| base::Time(),
|
| base::Time(),
|
| "c", "d"));
|
|
|
| - DefaultServerBoundCertStore store(persistent_store.get());
|
| - ServerBoundCertStore::ServerBoundCertList source_certs;
|
| - source_certs.push_back(ServerBoundCertStore::ServerBoundCert(
|
| + DefaultChannelIDStore store(persistent_store.get());
|
| + ChannelIDStore::ChannelIDList source_certs;
|
| + source_certs.push_back(ChannelIDStore::ChannelID(
|
| "both.com",
|
| base::Time(),
|
| base::Time(),
|
| // Key differs from above to test that existing entries are overwritten.
|
| "e", "f"));
|
| - source_certs.push_back(ServerBoundCertStore::ServerBoundCert(
|
| + source_certs.push_back(ChannelIDStore::ChannelID(
|
| "copied.com",
|
| base::Time(),
|
| base::Time(),
|
| @@ -535,11 +535,11 @@ TEST(DefaultServerBoundCertStoreTest, TestAsyncInitializeFrom) {
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_EQ(3, store.GetCertCount());
|
|
|
| - ServerBoundCertStore::ServerBoundCertList certs;
|
| - store.GetAllServerBoundCerts(base::Bind(GetAllCallback, &certs));
|
| + ChannelIDStore::ChannelIDList certs;
|
| + store.GetAllChannelIDs(base::Bind(GetAllCallback, &certs));
|
| ASSERT_EQ(3u, certs.size());
|
|
|
| - ServerBoundCertStore::ServerBoundCertList::iterator cert = certs.begin();
|
| + ChannelIDStore::ChannelIDList::iterator cert = certs.begin();
|
| EXPECT_EQ("both.com", cert->server_identifier());
|
| EXPECT_EQ("e", cert->private_key());
|
|
|
|
|