OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "net/base/address_list.h" | 8 #include "net/base/address_list.h" |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/base/net_log_unittest.h" | 10 #include "net/base/net_log_unittest.h" |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 | 1269 |
1270 AssertConnectSucceeds(); | 1270 AssertConnectSucceeds(); |
1271 | 1271 |
1272 EXPECT_TRUE(sock_->IsConnected()); | 1272 EXPECT_TRUE(sock_->IsConnected()); |
1273 | 1273 |
1274 DeleteSockCallback read_callback(&sock_); | 1274 DeleteSockCallback read_callback(&sock_); |
1275 | 1275 |
1276 scoped_refptr<IOBuffer> read_buf(new IOBuffer(kLen1)); | 1276 scoped_refptr<IOBuffer> read_buf(new IOBuffer(kLen1)); |
1277 ASSERT_EQ(ERR_IO_PENDING, | 1277 ASSERT_EQ(ERR_IO_PENDING, |
1278 sock_->Read(read_buf, kLen1, | 1278 sock_->Read(read_buf, kLen1, |
1279 base::Bind(&DeleteSockCallback::Run<int>, | 1279 base::Bind(&OldCompletionCallbackAdapter, |
1280 base::Unretained(&read_callback)))); | 1280 &read_callback))); |
1281 | 1281 |
1282 scoped_refptr<IOBufferWithSize> write_buf(CreateBuffer(kMsg1, kLen1)); | 1282 scoped_refptr<IOBufferWithSize> write_buf(CreateBuffer(kMsg1, kLen1)); |
1283 EXPECT_EQ(ERR_IO_PENDING, sock_->Write(write_buf, write_buf->size(), | 1283 EXPECT_EQ(ERR_IO_PENDING, sock_->Write(write_buf, write_buf->size(), |
1284 write_callback_.callback())); | 1284 write_callback_.callback())); |
1285 | 1285 |
1286 Run(2); | 1286 Run(2); |
1287 | 1287 |
1288 EXPECT_FALSE(sock_.get()); | 1288 EXPECT_FALSE(sock_.get()); |
1289 EXPECT_TRUE(read_callback.have_result()); | 1289 EXPECT_TRUE(read_callback.have_result()); |
1290 EXPECT_FALSE(write_callback_.have_result()); | 1290 EXPECT_FALSE(write_callback_.have_result()); |
1291 } | 1291 } |
1292 | 1292 |
1293 } // namespace net | 1293 } // namespace net |
OLD | NEW |