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

Unified Diff: net/proxy/proxy_service_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
Index: net/proxy/proxy_service_unittest.cc
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index aacefbd6de1de96fcc282563eaf01b077225dfff..066a3eb74210bab85d13cfbbf98ee1da9eb90040 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -19,6 +19,7 @@
#include "net/base/proxy_delegate.h"
#include "net/base/test_completion_callback.h"
#include "net/log/net_log.h"
+#include "net/log/net_log_event_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"
@@ -385,13 +386,12 @@ TEST_F(ProxyServiceTest, Direct) {
log.GetEntries(&entries);
EXPECT_EQ(3u, entries.size());
- EXPECT_TRUE(LogContainsBeginEvent(
- entries, 0, NetLog::TYPE_PROXY_SERVICE));
+ EXPECT_TRUE(
+ LogContainsBeginEvent(entries, 0, NetLogEventType::PROXY_SERVICE));
EXPECT_TRUE(LogContainsEvent(
- entries, 1, NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
- NetLog::PHASE_NONE));
- EXPECT_TRUE(LogContainsEndEvent(
- entries, 2, NetLog::TYPE_PROXY_SERVICE));
+ entries, 1, NetLogEventType::PROXY_SERVICE_RESOLVED_PROXY_LIST,
+ NetLogEventPhase::NONE));
+ EXPECT_TRUE(LogContainsEndEvent(entries, 2, NetLogEventType::PROXY_SERVICE));
}
TEST_F(ProxyServiceTest, OnResolveProxyCallbackAddProxy) {
@@ -542,14 +542,13 @@ TEST_F(ProxyServiceTest, PAC) {
log.GetEntries(&entries);
EXPECT_EQ(5u, entries.size());
+ EXPECT_TRUE(
+ LogContainsBeginEvent(entries, 0, NetLogEventType::PROXY_SERVICE));
EXPECT_TRUE(LogContainsBeginEvent(
- entries, 0, NetLog::TYPE_PROXY_SERVICE));
- EXPECT_TRUE(LogContainsBeginEvent(
- entries, 1, NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC));
- EXPECT_TRUE(LogContainsEndEvent(
- entries, 2, NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC));
+ entries, 1, NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC));
EXPECT_TRUE(LogContainsEndEvent(
- entries, 4, NetLog::TYPE_PROXY_SERVICE));
+ entries, 2, NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC));
+ EXPECT_TRUE(LogContainsEndEvent(entries, 4, NetLogEventType::PROXY_SERVICE));
}
// Test that the proxy resolver does not see the URL's username/password
@@ -2244,16 +2243,15 @@ TEST_F(ProxyServiceTest, CancelWhilePACFetching) {
// Check the NetLog for request 1 (which was cancelled) got filled properly.
EXPECT_EQ(4u, entries1.size());
+ EXPECT_TRUE(
+ LogContainsBeginEvent(entries1, 0, NetLogEventType::PROXY_SERVICE));
EXPECT_TRUE(LogContainsBeginEvent(
- entries1, 0, NetLog::TYPE_PROXY_SERVICE));
- EXPECT_TRUE(LogContainsBeginEvent(
- entries1, 1, NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC));
- // Note that TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC is never completed before
+ entries1, 1, NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC));
+ // Note that PROXY_SERVICE_WAITING_FOR_INIT_PAC is never completed before
// the cancellation occured.
- EXPECT_TRUE(LogContainsEvent(
- entries1, 2, NetLog::TYPE_CANCELLED, NetLog::PHASE_NONE));
- EXPECT_TRUE(LogContainsEndEvent(
- entries1, 3, NetLog::TYPE_PROXY_SERVICE));
+ EXPECT_TRUE(LogContainsEvent(entries1, 2, NetLogEventType::CANCELLED,
+ NetLogEventPhase::NONE));
+ EXPECT_TRUE(LogContainsEndEvent(entries1, 3, NetLogEventType::PROXY_SERVICE));
}
// Test that if auto-detect fails, we fall-back to the custom pac.
@@ -2796,10 +2794,10 @@ TEST_F(ProxyServiceTest, NetworkChangeTriggersPacRefetch) {
log.GetEntries(&entries);
EXPECT_TRUE(LogContainsEntryWithType(entries, 0,
- NetLog::TYPE_PROXY_CONFIG_CHANGED));
+ NetLogEventType::PROXY_CONFIG_CHANGED));
ASSERT_EQ(9u, entries.size());
for (size_t i = 1; i < entries.size(); ++i)
- EXPECT_NE(NetLog::TYPE_PROXY_CONFIG_CHANGED, entries[i].type);
+ EXPECT_NE(NetLogEventType::PROXY_CONFIG_CHANGED, entries[i].type);
}
// This test verifies that the PAC script specified by the settings is
« no previous file with comments | « net/proxy/proxy_service_mojo_unittest.cc ('k') | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698