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: net/log/write_to_file_net_log_observer_unittest.cc

Issue 1059843002: Refactor NetLog::LogLevel --> NetLogCaptureMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix a merge conflict Created 5 years, 8 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/write_to_file_net_log_observer.cc ('k') | net/net.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/write_to_file_net_log_observer_unittest.cc
diff --git a/net/log/write_to_file_net_log_observer_unittest.cc b/net/log/write_to_file_net_log_observer_unittest.cc
index 4c12cf3dda85334db3f11a19933b078a352be08e..4cabfe8cc83eece142915f15b53a3ebbe822bbbe 100644
--- a/net/log/write_to_file_net_log_observer_unittest.cc
+++ b/net/log/write_to_file_net_log_observer_unittest.cc
@@ -61,21 +61,23 @@ TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONForNoEvents) {
ASSERT_TRUE(dict->GetDictionary("constants", &constants));
}
-TEST_F(WriteToFileNetLogObserverTest, LogLevel) {
+TEST_F(WriteToFileNetLogObserverTest, CaptureMode) {
base::ScopedFILE file(base::OpenFile(log_path_, "w"));
ASSERT_TRUE(file);
WriteToFileNetLogObserver logger;
logger.StartObserving(&net_log_, file.Pass(), nullptr, nullptr);
- EXPECT_EQ(NetLog::LOG_STRIP_PRIVATE_DATA, logger.log_level());
- EXPECT_EQ(NetLog::LOG_STRIP_PRIVATE_DATA, net_log_.GetLogLevel());
+ EXPECT_EQ(NetLogCaptureMode::Default(), logger.capture_mode());
+ EXPECT_EQ(NetLogCaptureMode::Default(), net_log_.GetCaptureMode());
logger.StopObserving(nullptr);
file.reset(base::OpenFile(log_path_, "w"));
ASSERT_TRUE(file);
- logger.set_log_level(NetLog::LOG_ALL_BUT_BYTES);
+ logger.set_capture_mode(NetLogCaptureMode::IncludeCookiesAndCredentials());
logger.StartObserving(&net_log_, file.Pass(), nullptr, nullptr);
- EXPECT_EQ(NetLog::LOG_ALL_BUT_BYTES, logger.log_level());
- EXPECT_EQ(NetLog::LOG_ALL_BUT_BYTES, net_log_.GetLogLevel());
+ EXPECT_EQ(NetLogCaptureMode::IncludeCookiesAndCredentials(),
+ logger.capture_mode());
+ EXPECT_EQ(NetLogCaptureMode::IncludeCookiesAndCredentials(),
+ net_log_.GetCaptureMode());
logger.StopObserving(nullptr);
}
@@ -90,7 +92,7 @@ TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONWithOneEvent) {
NetLog::EntryData entry_data(NetLog::TYPE_PROXY_SERVICE, source,
NetLog::PHASE_BEGIN, base::TimeTicks::Now(),
NULL);
- NetLog::Entry entry(&entry_data, NetLog::LOG_ALL);
+ NetLog::Entry entry(&entry_data, NetLogCaptureMode::IncludeSocketBytes());
logger->OnAddEntry(entry);
logger->StopObserving(nullptr);
logger.reset();
@@ -120,7 +122,7 @@ TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONWithMultipleEvents) {
NetLog::EntryData entry_data(NetLog::TYPE_PROXY_SERVICE, source,
NetLog::PHASE_BEGIN, base::TimeTicks::Now(),
NULL);
- NetLog::Entry entry(&entry_data, NetLog::LOG_ALL);
+ NetLog::Entry entry(&entry_data, NetLogCaptureMode::IncludeSocketBytes());
// Add the entry multiple times.
logger->OnAddEntry(entry);
« no previous file with comments | « net/log/write_to_file_net_log_observer.cc ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698