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()); |
mmenke
2017/07/06 21:31:29
How is this guaranteed? Deletion occurs on anothe
eroman
2017/07/06 21:57:54
This is guaranteed by the changes I made in the de
|
} |
+// 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()); |
mmenke
2017/07/06 21:31:29
How is this guaranteed? The file is created on an
eroman
2017/07/06 21:57:54
same explanation as above.
|
+ |
+ 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; |