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

Unified Diff: components/certificate_reporting/error_report_unittest.cc

Issue 2524903004: Record the time when the interstitial is constructed (Closed)
Patch Set: Created 4 years, 1 month 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: 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..4adbb652ce31477a394beba391631cdbf8ba58f1 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);
+ base::Time interstitial_time = base::Time::Now();
meacer 2016/11/23 23:27:49 nit: const
estark 2016/11/24 00:00:16 Done.
+ report.SetInterstitialInfo(
+ ErrorReport::INTERSTITIAL_CLOCK, ErrorReport::USER_PROCEEDED,
+ ErrorReport::INTERSTITIAL_OVERRIDABLE, interstitial_time);
ASSERT_TRUE(report.Serialize(&serialized_report));
@@ -153,6 +154,9 @@ TEST(ErrorReportTest, SerializedReportAsProtobufWithInterstitialInfo) {
EXPECT_THAT(
deserialized_report.cert_error(),
UnorderedElementsAre(kFirstReportedCertError, kSecondReportedCertError));
+
+ EXPECT_EQ(interstitial_time.ToInternalValue(),
+ deserialized_report.interstitial_info().interstitial_time_usec());
}
// Test that a serialized report can be parsed.

Powered by Google App Engine
This is Rietveld 408576698