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

Unified Diff: components/certificate_reporting/error_report_unittest.cc

Issue 2575233003: Record the time when the interstitial is constructed (Closed)
Patch Set: Created 4 years 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 | « components/certificate_reporting/error_report.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/certificate_reporting/error_report_unittest.cc
diff --git a/components/certificate_reporting/error_report_unittest.cc b/components/certificate_reporting/error_report_unittest.cc
index df0dbef294ca946a112da283b57836f9c20324d1..0ecd92277cccad9756fd6b9892ce0935b675e27c 100644
--- a/components/certificate_reporting/error_report_unittest.cc
+++ b/components/certificate_reporting/error_report_unittest.cc
@@ -128,9 +128,10 @@ TEST(ErrorReportTest, SerializedReportAsProtobufWithInterstitialInfo) {
GetTestSSLInfo(EXCLUDE_UNVERIFIED_CERT_CHAIN, &ssl_info, kCertStatus));
ErrorReport report(kDummyHostname, ssl_info);
- report.SetInterstitialInfo(ErrorReport::INTERSTITIAL_CLOCK,
- ErrorReport::USER_PROCEEDED,
- ErrorReport::INTERSTITIAL_OVERRIDABLE);
+ const base::Time interstitial_time = base::Time::Now();
+ report.SetInterstitialInfo(
+ ErrorReport::INTERSTITIAL_CLOCK, ErrorReport::USER_PROCEEDED,
+ ErrorReport::INTERSTITIAL_OVERRIDABLE, interstitial_time);
ASSERT_TRUE(report.Serialize(&serialized_report));
@@ -153,6 +154,10 @@ TEST(ErrorReportTest, SerializedReportAsProtobufWithInterstitialInfo) {
EXPECT_THAT(
deserialized_report.cert_error(),
UnorderedElementsAre(kFirstReportedCertError, kSecondReportedCertError));
+
+ EXPECT_EQ(
+ interstitial_time.ToInternalValue(),
+ deserialized_report.interstitial_info().interstitial_created_time_usec());
}
// Test that a serialized report can be parsed.
« no previous file with comments | « components/certificate_reporting/error_report.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698