Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6130)

Unified Diff: chrome/browser/browsing_data_remover_unittest.cc

Issue 9617039: Change Origin bound certs -> Domain bound certs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: explanitory comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data_remover_unittest.cc
diff --git a/chrome/browser/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data_remover_unittest.cc
index fa3cb4599b31e48aece0481484cdcbc7d9fcf0ed..e1c46e386ec149a0552916a966366e6f961e1fd5 100644
--- a/chrome/browser/browsing_data_remover_unittest.cc
+++ b/chrome/browser/browsing_data_remover_unittest.cc
@@ -204,13 +204,13 @@ class RemoveOriginBoundCertTester : public BrowsingDataRemoverTester {
origin_bound_cert_service();
Mike West 2012/03/07 10:31:47 Is this still called "origin_bound_cert_service"?
}
- int OriginBoundCertCount() {
+ int DomainBoundCertCount() {
return ob_cert_service_->cert_count();
Mike West 2012/03/07 10:31:47 Nit: db_cert_service
}
- // Add an origin bound cert for |origin| with specific creation and expiry
+ // Add an domain bound cert for |origin| with specific creation and expiry
Mike West 2012/03/07 10:31:47 Nit: fix the variable name here and in the functio
// times. The cert and key data will be filled with dummy values.
- void AddOriginBoundCertWithTimes(const std::string& origin,
+ void AddDomainBoundCertWithTimes(const std::string& origin,
base::Time creation_time,
base::Time expiration_time) {
GetCertStore()->SetOriginBoundCert(origin, net::CLIENT_CERT_RSA_SIGN,
@@ -220,9 +220,9 @@ class RemoveOriginBoundCertTester : public BrowsingDataRemoverTester {
// Add an origin bound cert for |origin|, with the current time as the
Mike West 2012/03/07 10:31:47 Nit: fix the comment here, and the variable name b
// creation time. The cert and key data will be filled with dummy values.
- void AddOriginBoundCert(const std::string& origin) {
+ void AddDomainBoundCert(const std::string& origin) {
base::Time now = base::Time::Now();
- AddOriginBoundCertWithTimes(origin,
+ AddDomainBoundCertWithTimes(origin,
now,
now + base::TimeDelta::FromDays(1));
}
@@ -515,14 +515,14 @@ TEST_F(BrowsingDataRemoverTest, RemoveOriginBoundCertForever) {
scoped_ptr<RemoveOriginBoundCertTester> tester(
new RemoveOriginBoundCertTester(GetProfile()));
- tester->AddOriginBoundCert(kTestkOrigin1);
- EXPECT_EQ(1, tester->OriginBoundCertCount());
+ tester->AddDomainBoundCert(kTestkOrigin1);
+ EXPECT_EQ(1, tester->DomainBoundCertCount());
BlockUntilBrowsingDataRemoved(BrowsingDataRemover::EVERYTHING,
- BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS, tester.get());
+ BrowsingDataRemover::REMOVE_DOMAIN_BOUND_CERTS, tester.get());
- EXPECT_EQ(BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS, GetRemovalMask());
- EXPECT_EQ(0, tester->OriginBoundCertCount());
+ EXPECT_EQ(BrowsingDataRemover::REMOVE_DOMAIN_BOUND_CERTS, GetRemovalMask());
+ EXPECT_EQ(0, tester->DomainBoundCertCount());
}
TEST_F(BrowsingDataRemoverTest, RemoveOriginBoundCertLastHour) {
Mike West 2012/03/07 10:31:47 RemoveDomainBoundCertLastHour
@@ -530,20 +530,20 @@ TEST_F(BrowsingDataRemoverTest, RemoveOriginBoundCertLastHour) {
new RemoveOriginBoundCertTester(GetProfile()));
base::Time now = base::Time::Now();
- tester->AddOriginBoundCert(kTestkOrigin1);
- tester->AddOriginBoundCertWithTimes(kTestkOrigin2,
+ tester->AddDomainBoundCert(kTestkOrigin1);
+ tester->AddDomainBoundCertWithTimes(kTestkOrigin2,
now - base::TimeDelta::FromHours(2),
now);
- EXPECT_EQ(2, tester->OriginBoundCertCount());
+ EXPECT_EQ(2, tester->DomainBoundCertCount());
BlockUntilBrowsingDataRemoved(BrowsingDataRemover::LAST_HOUR,
- BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS, tester.get());
+ BrowsingDataRemover::REMOVE_DOMAIN_BOUND_CERTS, tester.get());
- EXPECT_EQ(BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS, GetRemovalMask());
- EXPECT_EQ(1, tester->OriginBoundCertCount());
+ EXPECT_EQ(BrowsingDataRemover::REMOVE_DOMAIN_BOUND_CERTS, GetRemovalMask());
+ EXPECT_EQ(1, tester->DomainBoundCertCount());
std::vector<net::OriginBoundCertStore::OriginBoundCert> certs;
tester->GetCertStore()->GetAllOriginBoundCerts(&certs);
- EXPECT_EQ(kTestkOrigin2, certs[0].origin());
+ EXPECT_EQ(kTestkOrigin2, certs[0].domain());
}
TEST_F(BrowsingDataRemoverTest, RemoveHistoryForever) {

Powered by Google App Engine
This is Rietveld 408576698