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

Unified Diff: net/log/net_log_unittest.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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/net_log_source_type.h ('k') | net/log/net_log_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/net_log_unittest.cc
diff --git a/net/log/net_log_unittest.cc b/net/log/net_log_unittest.cc
index f8650a754e888c98606c08339a60a90c8ca980fa..11ec5ee64382073000a3e4f3055b49001c7842e2 100644
--- a/net/log/net_log_unittest.cc
+++ b/net/log/net_log_unittest.cc
@@ -13,6 +13,8 @@
#include "base/threading/simple_thread.h"
#include "base/values.h"
#include "net/base/net_errors.h"
+#include "net/log/net_log_event_type.h"
+#include "net/log/net_log_source_type.h"
#include "net/log/test_net_log.h"
#include "net/log/test_net_log_entry.h"
#include "net/log/test_net_log_util.h"
@@ -58,14 +60,14 @@ TEST(NetLogTest, Basic) {
net_log.GetEntries(&entries);
EXPECT_EQ(0u, entries.size());
- net_log.AddGlobalEntry(NetLog::TYPE_CANCELLED);
+ net_log.AddGlobalEntry(NetLogEventType::CANCELLED);
net_log.GetEntries(&entries);
ASSERT_EQ(1u, entries.size());
- EXPECT_EQ(NetLog::TYPE_CANCELLED, entries[0].type);
- EXPECT_EQ(NetLog::SOURCE_NONE, entries[0].source.type);
+ EXPECT_EQ(NetLogEventType::CANCELLED, entries[0].type);
+ EXPECT_EQ(NetLogSourceType::NONE, entries[0].source.type);
EXPECT_NE(NetLog::Source::kInvalidId, entries[0].source.id);
- EXPECT_EQ(NetLog::PHASE_NONE, entries[0].phase);
+ EXPECT_EQ(NetLogEventPhase::NONE, entries[0].phase);
EXPECT_GE(base::TimeTicks::Now(), entries[0].time);
EXPECT_FALSE(entries[0].params);
}
@@ -84,17 +86,17 @@ TEST(NetLogTest, CaptureModes) {
net_log.SetCaptureMode(mode);
EXPECT_EQ(mode, net_log.GetObserver()->capture_mode());
- net_log.AddGlobalEntry(NetLog::TYPE_SOCKET_ALIVE,
+ net_log.AddGlobalEntry(NetLogEventType::SOCKET_ALIVE,
base::Bind(NetCaptureModeCallback));
TestNetLogEntry::List entries;
net_log.GetEntries(&entries);
ASSERT_EQ(1u, entries.size());
- EXPECT_EQ(NetLog::TYPE_SOCKET_ALIVE, entries[0].type);
- EXPECT_EQ(NetLog::SOURCE_NONE, entries[0].source.type);
+ EXPECT_EQ(NetLogEventType::SOCKET_ALIVE, entries[0].type);
+ EXPECT_EQ(NetLogSourceType::NONE, entries[0].source.type);
EXPECT_NE(NetLog::Source::kInvalidId, entries[0].source.id);
- EXPECT_EQ(NetLog::PHASE_NONE, entries[0].phase);
+ EXPECT_EQ(NetLogEventPhase::NONE, entries[0].phase);
EXPECT_GE(base::TimeTicks::Now(), entries[0].time);
int logged_capture_mode;
@@ -149,7 +151,7 @@ class LoggingObserver : public NetLog::ThreadSafeObserver {
};
void AddEvent(NetLog* net_log) {
- net_log->AddGlobalEntry(NetLog::TYPE_CANCELLED,
+ net_log->AddGlobalEntry(NetLogEventType::CANCELLED,
base::Bind(CaptureModeToValue));
}
« no previous file with comments | « net/log/net_log_source_type.h ('k') | net/log/net_log_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698