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

Unified Diff: net/log/file_net_log_observer_unittest.cc

Issue 2973673003: Use FileNetLogObserver for implementing --log-net-log. (Closed)
Patch Set: address comments Created 3 years, 5 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 | « net/log/file_net_log_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/file_net_log_observer_unittest.cc
diff --git a/net/log/file_net_log_observer_unittest.cc b/net/log/file_net_log_observer_unittest.cc
index 9683e135ab69faceea5d8828cf35d27664e46155..75082a766fa141248a12e966488c8d367dead68b 100644
--- a/net/log/file_net_log_observer_unittest.cc
+++ b/net/log/file_net_log_observer_unittest.cc
@@ -287,6 +287,24 @@ TEST_P(FileNetLogObserverTest, ObserverDestroyedWithoutStopObserving) {
ASSERT_FALSE(LogFilesExist());
}
+// Tests calling StopObserving() with a null closure.
+TEST_P(FileNetLogObserverTest, StopObservingNullClosure) {
+ CreateAndStartObserving(nullptr);
+
+ // Send dummy event
+ AddEntries(logger_.get(), 1, kDummyEventSize);
+
+ // The log files should have been started.
+ ASSERT_TRUE(LogFilesExist());
+
+ logger_->StopObserving(nullptr, base::OnceClosure());
+
+ logger_.reset();
+
+ // Since the logger was explicitly stopped, its files should still exist.
+ ASSERT_TRUE(LogFilesExist());
+}
+
TEST_P(FileNetLogObserverTest, GeneratesValidJSONWithNoEvents) {
TestClosure closure;
« no previous file with comments | « net/log/file_net_log_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698