| OLD | NEW |
| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| 11 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
| 12 #include "net/base/winsock_init.h" | 12 #include "net/base/winsock_init.h" |
| 13 #include "net/dns/mock_host_resolver.h" | 13 #include "net/dns/mock_host_resolver.h" |
| 14 #include "net/http/http_response_headers.h" | 14 #include "net/http/http_response_headers.h" |
| 15 #include "net/http/http_response_info.h" | 15 #include "net/http/http_response_info.h" |
| 16 #include "net/log/captured_net_log_entry.h" |
| 16 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
| 17 #include "net/log/net_log_unittest.h" | 18 #include "net/log/net_log_unittest.h" |
| 18 #include "net/log/test_net_log.h" | 19 #include "net/log/test_net_log.h" |
| 19 #include "net/socket/client_socket_factory.h" | 20 #include "net/socket/client_socket_factory.h" |
| 20 #include "net/socket/next_proto.h" | 21 #include "net/socket/next_proto.h" |
| 21 #include "net/socket/socket_test_util.h" | 22 #include "net/socket/socket_test_util.h" |
| 22 #include "net/socket/tcp_client_socket.h" | 23 #include "net/socket/tcp_client_socket.h" |
| 23 #include "net/spdy/buffered_spdy_framer.h" | 24 #include "net/spdy/buffered_spdy_framer.h" |
| 24 #include "net/spdy/spdy_http_utils.h" | 25 #include "net/spdy/spdy_http_utils.h" |
| 25 #include "net/spdy/spdy_protocol.h" | 26 #include "net/spdy/spdy_protocol.h" |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 | 1268 |
| 1268 AssertConnectSucceeds(); | 1269 AssertConnectSucceeds(); |
| 1269 | 1270 |
| 1270 Run(1); // SpdySession consumes the next read and sends it to | 1271 Run(1); // SpdySession consumes the next read and sends it to |
| 1271 // sock_ to be buffered. | 1272 // sock_ to be buffered. |
| 1272 AssertSyncReadEquals(kMsg1, kLen1); | 1273 AssertSyncReadEquals(kMsg1, kLen1); |
| 1273 | 1274 |
| 1274 NetLog::Source sock_source = sock_->NetLog().source(); | 1275 NetLog::Source sock_source = sock_->NetLog().source(); |
| 1275 sock_.reset(); | 1276 sock_.reset(); |
| 1276 | 1277 |
| 1277 TestNetLog::CapturedEntryList entry_list; | 1278 CapturedNetLogEntry::List entry_list; |
| 1278 net_log_.GetEntriesForSource(sock_source, &entry_list); | 1279 net_log_.GetEntriesForSource(sock_source, &entry_list); |
| 1279 | 1280 |
| 1280 ASSERT_EQ(entry_list.size(), 10u); | 1281 ASSERT_EQ(entry_list.size(), 10u); |
| 1281 EXPECT_TRUE(LogContainsBeginEvent(entry_list, 0, NetLog::TYPE_SOCKET_ALIVE)); | 1282 EXPECT_TRUE(LogContainsBeginEvent(entry_list, 0, NetLog::TYPE_SOCKET_ALIVE)); |
| 1282 EXPECT_TRUE(LogContainsEvent(entry_list, 1, | 1283 EXPECT_TRUE(LogContainsEvent(entry_list, 1, |
| 1283 NetLog::TYPE_HTTP2_PROXY_CLIENT_SESSION, | 1284 NetLog::TYPE_HTTP2_PROXY_CLIENT_SESSION, |
| 1284 NetLog::PHASE_NONE)); | 1285 NetLog::PHASE_NONE)); |
| 1285 EXPECT_TRUE(LogContainsBeginEvent(entry_list, 2, | 1286 EXPECT_TRUE(LogContainsBeginEvent(entry_list, 2, |
| 1286 NetLog::TYPE_HTTP_TRANSACTION_TUNNEL_SEND_REQUEST)); | 1287 NetLog::TYPE_HTTP_TRANSACTION_TUNNEL_SEND_REQUEST)); |
| 1287 EXPECT_TRUE(LogContainsEvent(entry_list, 3, | 1288 EXPECT_TRUE(LogContainsEvent(entry_list, 3, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 | 1373 |
| 1373 EXPECT_FALSE(sock_.get()); | 1374 EXPECT_FALSE(sock_.get()); |
| 1374 EXPECT_TRUE(read_callback.have_result()); | 1375 EXPECT_TRUE(read_callback.have_result()); |
| 1375 EXPECT_FALSE(write_callback_.have_result()); | 1376 EXPECT_FALSE(write_callback_.have_result()); |
| 1376 | 1377 |
| 1377 // Let the RST_STREAM write while |rst| is in-scope. | 1378 // Let the RST_STREAM write while |rst| is in-scope. |
| 1378 base::MessageLoop::current()->RunUntilIdle(); | 1379 base::MessageLoop::current()->RunUntilIdle(); |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 } // namespace net | 1382 } // namespace net |
| OLD | NEW |