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

Side by Side Diff: net/spdy/spdy_proxy_client_socket_unittest.cc

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_proxy_client_socket.h" 5 #include "net/spdy/spdy_proxy_client_socket.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "net/base/address_list.h" 14 #include "net/base/address_list.h"
15 #include "net/base/test_completion_callback.h" 15 #include "net/base/test_completion_callback.h"
16 #include "net/base/winsock_init.h" 16 #include "net/base/winsock_init.h"
17 #include "net/dns/mock_host_resolver.h" 17 #include "net/dns/mock_host_resolver.h"
18 #include "net/http/http_response_headers.h" 18 #include "net/http/http_response_headers.h"
19 #include "net/http/http_response_info.h" 19 #include "net/http/http_response_info.h"
20 #include "net/log/net_log.h"
21 #include "net/log/net_log_event_type.h" 20 #include "net/log/net_log_event_type.h"
21 #include "net/log/net_log_source.h"
22 #include "net/log/test_net_log.h" 22 #include "net/log/test_net_log.h"
23 #include "net/log/test_net_log_entry.h" 23 #include "net/log/test_net_log_entry.h"
24 #include "net/log/test_net_log_util.h" 24 #include "net/log/test_net_log_util.h"
25 #include "net/socket/client_socket_factory.h" 25 #include "net/socket/client_socket_factory.h"
26 #include "net/socket/socket_test_util.h" 26 #include "net/socket/socket_test_util.h"
27 #include "net/socket/tcp_client_socket.h" 27 #include "net/socket/tcp_client_socket.h"
28 #include "net/spdy/buffered_spdy_framer.h" 28 #include "net/spdy/buffered_spdy_framer.h"
29 #include "net/spdy/spdy_http_utils.h" 29 #include "net/spdy/spdy_http_utils.h"
30 #include "net/spdy/spdy_protocol.h" 30 #include "net/spdy/spdy_protocol.h"
31 #include "net/spdy/spdy_session_pool.h" 31 #include "net/spdy/spdy_session_pool.h"
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 }; 1246 };
1247 1247
1248 Initialize(reads, arraysize(reads), writes, arraysize(writes)); 1248 Initialize(reads, arraysize(reads), writes, arraysize(writes));
1249 1249
1250 AssertConnectSucceeds(); 1250 AssertConnectSucceeds();
1251 1251
1252 // SpdySession consumes the next read and sends it to sock_ to be buffered. 1252 // SpdySession consumes the next read and sends it to sock_ to be buffered.
1253 ResumeAndRun(); 1253 ResumeAndRun();
1254 AssertSyncReadEquals(kMsg1, kLen1); 1254 AssertSyncReadEquals(kMsg1, kLen1);
1255 1255
1256 NetLog::Source sock_source = sock_->NetLog().source(); 1256 NetLogSource sock_source = sock_->NetLog().source();
1257 sock_.reset(); 1257 sock_.reset();
1258 1258
1259 TestNetLogEntry::List entry_list; 1259 TestNetLogEntry::List entry_list;
1260 net_log_.GetEntriesForSource(sock_source, &entry_list); 1260 net_log_.GetEntriesForSource(sock_source, &entry_list);
1261 1261
1262 ASSERT_EQ(entry_list.size(), 10u); 1262 ASSERT_EQ(entry_list.size(), 10u);
1263 EXPECT_TRUE( 1263 EXPECT_TRUE(
1264 LogContainsBeginEvent(entry_list, 0, NetLogEventType::SOCKET_ALIVE)); 1264 LogContainsBeginEvent(entry_list, 0, NetLogEventType::SOCKET_ALIVE));
1265 EXPECT_TRUE(LogContainsEvent(entry_list, 1, 1265 EXPECT_TRUE(LogContainsEvent(entry_list, 1,
1266 NetLogEventType::HTTP2_PROXY_CLIENT_SESSION, 1266 NetLogEventType::HTTP2_PROXY_CLIENT_SESSION,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 1354
1355 EXPECT_FALSE(sock_.get()); 1355 EXPECT_FALSE(sock_.get());
1356 EXPECT_TRUE(read_callback.have_result()); 1356 EXPECT_TRUE(read_callback.have_result());
1357 EXPECT_FALSE(write_callback_.have_result()); 1357 EXPECT_FALSE(write_callback_.have_result());
1358 1358
1359 // Let the RST_STREAM write while |rst| is in-scope. 1359 // Let the RST_STREAM write while |rst| is in-scope.
1360 base::RunLoop().RunUntilIdle(); 1360 base::RunLoop().RunUntilIdle();
1361 } 1361 }
1362 1362
1363 } // namespace net 1363 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698