Index: net/cookies/canonical_cookie_unittest.cc |
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc |
index 47b296de3e4aa319d2dfb274e88dcd7dca0e9048..5ebf5341338cb4e3c3f0ceb96f3df38d5a63fa7a 100644 |
--- a/net/cookies/canonical_cookie_unittest.cc |
+++ b/net/cookies/canonical_cookie_unittest.cc |
@@ -836,6 +836,17 @@ TEST(CanonicalCookieTest, IsCanonical) { |
.IsCanonical()); |
} |
+TEST(CanonicalCookieTest, TestSetCreationDate) { |
+ CanonicalCookie cookie("A", "B", "x.y", "/path", base::Time(), base::Time(), |
+ base::Time(), false, false, |
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW); |
+ EXPECT_TRUE(cookie.CreationDate().is_null()); |
+ |
+ base::Time now(base::Time::Now()); |
+ cookie.SetCreationDate(now); |
+ EXPECT_EQ(now, cookie.CreationDate()); |
+} |
+ |
TEST(CanonicalCookieTest, TestPrefixHistograms) { |
base::HistogramTester histograms; |
const char kCookiePrefixHistogram[] = "Cookie.CookiePrefix"; |