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

Unified Diff: components/certificate_transparency/single_tree_tracker_unittest.cc

Issue 2668803004: Certificate Transparency: Discard entries pending auditing on network change (Closed)
Patch Set: Merging with master Created 3 years, 10 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 | « components/certificate_transparency/single_tree_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/certificate_transparency/single_tree_tracker_unittest.cc
diff --git a/components/certificate_transparency/single_tree_tracker_unittest.cc b/components/certificate_transparency/single_tree_tracker_unittest.cc
index b5e0edf973639dbfe12009277a897ffa1ec699f4..ae0bd6ebdf432830eaef7a826a9765c9556b2ba3 100644
--- a/components/certificate_transparency/single_tree_tracker_unittest.cc
+++ b/components/certificate_transparency/single_tree_tracker_unittest.cc
@@ -720,4 +720,25 @@ TEST_F(SingleTreeTrackerTest,
histograms.ExpectBucketCount(kInclusionCheckResultHistogramName, 3, 1);
}
+// Test that entries are no longer pending after a network state
+// change.
+TEST_F(SingleTreeTrackerTest, DiscardsPendingEntriesAfterNetworkChange) {
+ CreateTreeTrackerWithDefaultDnsExpectation();
+
+ base::HistogramTester histograms;
+ tree_tracker_->OnSCTVerified(chain_.get(), cert_sct_.get());
+
+ EXPECT_EQ(
+ SingleTreeTracker::SCT_PENDING_NEWER_STH,
+ tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get()));
+
+ net_change_notifier_->NotifyObserversOfNetworkChangeForTests(
+ net::NetworkChangeNotifier::CONNECTION_UNKNOWN);
+ base::RunLoop().RunUntilIdle();
+
+ EXPECT_EQ(
+ SingleTreeTracker::SCT_NOT_OBSERVED,
+ tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get()));
+}
+
} // namespace certificate_transparency
« no previous file with comments | « components/certificate_transparency/single_tree_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698