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

Unified Diff: ios/web/net/cert_host_pair_unittest.cc

Issue 2000503002: Remove the fingerprint and ca_fingerprint from X509Certificate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
Patch Set: Fix IDN test Created 4 years, 6 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
« no previous file with comments | « ios/web/net/cert_host_pair.cc ('k') | ios/web/net/cert_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/cert_host_pair_unittest.cc
diff --git a/ios/web/net/cert_host_pair_unittest.cc b/ios/web/net/cert_host_pair_unittest.cc
index c8894d744fc39c2a1459bf6fa5c03babae207a45..118a75b8bbfa09f0612720367aea40ac42cab45b 100644
--- a/ios/web/net/cert_host_pair_unittest.cc
+++ b/ios/web/net/cert_host_pair_unittest.cc
@@ -35,8 +35,8 @@ TEST_F(CertHostPairTest, Construction) {
scoped_refptr<net::X509Certificate> cert = GetCert(kCertFileName1);
ASSERT_TRUE(cert);
CertHostPair pair(cert, kHostName1);
- EXPECT_EQ(cert, pair.cert);
- EXPECT_EQ(std::string(kHostName1), pair.host);
+ EXPECT_EQ(cert, pair.cert_);
+ EXPECT_EQ(std::string(kHostName1), pair.host_);
}
// Tests comparision with different certs and hosts.
@@ -48,8 +48,10 @@ TEST_F(CertHostPairTest, ComparisonWithDifferentCertsAndHosts) {
CertHostPair pair1(cert1, kHostName1);
CertHostPair pair2(cert2, kHostName2);
- EXPECT_TRUE(pair2 < pair1);
- EXPECT_FALSE(pair1 < pair2);
+ EXPECT_FALSE(pair1 < pair1);
+ EXPECT_FALSE(pair2 < pair2);
+ EXPECT_TRUE((pair1 < pair2 && !(pair2 < pair1)) ||
+ (pair2 < pair1 && !(pair1 < pair2)));
}
// Tests comparision with same cert.
@@ -61,8 +63,10 @@ TEST_F(CertHostPairTest, ComparisonWithSameCert) {
CertHostPair pair1(cert1, kHostName1);
CertHostPair pair2(cert2, kHostName2);
- EXPECT_TRUE(pair2 < pair1);
- EXPECT_FALSE(pair1 < pair2);
+ EXPECT_FALSE(pair1 < pair1);
+ EXPECT_FALSE(pair2 < pair2);
+ EXPECT_TRUE((pair1 < pair2 && !(pair2 < pair1)) ||
+ (pair2 < pair1 && !(pair1 < pair2)));
}
// Tests comparision with same host.
@@ -74,8 +78,10 @@ TEST_F(CertHostPairTest, ComparisonWithSameHost) {
CertHostPair pair1(cert1, kHostName1);
CertHostPair pair2(cert2, kHostName1);
- EXPECT_TRUE(pair1 < pair2);
- EXPECT_FALSE(pair2 < pair1);
+ EXPECT_FALSE(pair1 < pair1);
+ EXPECT_FALSE(pair2 < pair2);
+ EXPECT_TRUE((pair1 < pair2 && !(pair2 < pair1)) ||
+ (pair2 < pair1 && !(pair1 < pair2)));
}
// Tests comparision with same cert and host.
@@ -87,6 +93,8 @@ TEST_F(CertHostPairTest, ComparisonWithSameCertAndHost) {
CertHostPair pair1(cert1, kHostName1);
CertHostPair pair2(cert2, kHostName1);
+ EXPECT_FALSE(pair1 < pair1);
+ EXPECT_FALSE(pair2 < pair2);
EXPECT_FALSE(pair1 < pair2);
EXPECT_FALSE(pair2 < pair1);
}
« no previous file with comments | « ios/web/net/cert_host_pair.cc ('k') | ios/web/net/cert_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698