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 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 | 1339 |
1340 AssertConnectSucceeds(); | 1340 AssertConnectSucceeds(); |
1341 | 1341 |
1342 EXPECT_TRUE(sock_->IsConnected()); | 1342 EXPECT_TRUE(sock_->IsConnected()); |
1343 | 1343 |
1344 DeleteSockCallback read_callback(&sock_); | 1344 DeleteSockCallback read_callback(&sock_); |
1345 | 1345 |
1346 scoped_refptr<IOBuffer> read_buf(new IOBuffer(kLen1)); | 1346 scoped_refptr<IOBuffer> read_buf(new IOBuffer(kLen1)); |
1347 ASSERT_EQ(ERR_IO_PENDING, | 1347 ASSERT_EQ(ERR_IO_PENDING, |
1348 sock_->Read(read_buf, kLen1, | 1348 sock_->Read(read_buf, kLen1, |
1349 base::Bind(&DeleteSockCallback::Run<int>, | 1349 base::Bind(&OldCompletionCallbackAdapter, |
1350 base::Unretained(&read_callback)))); | 1350 &read_callback))); |
1351 | 1351 |
1352 scoped_refptr<IOBufferWithSize> write_buf(CreateBuffer(kMsg1, kLen1)); | 1352 scoped_refptr<IOBufferWithSize> write_buf(CreateBuffer(kMsg1, kLen1)); |
1353 EXPECT_EQ(ERR_IO_PENDING, sock_->Write(write_buf, write_buf->size(), | 1353 EXPECT_EQ(ERR_IO_PENDING, sock_->Write(write_buf, write_buf->size(), |
1354 write_callback_.callback())); | 1354 write_callback_.callback())); |
1355 | 1355 |
1356 Run(2); | 1356 Run(2); |
1357 | 1357 |
1358 EXPECT_FALSE(sock_.get()); | 1358 EXPECT_FALSE(sock_.get()); |
1359 EXPECT_TRUE(read_callback.have_result()); | 1359 EXPECT_TRUE(read_callback.have_result()); |
1360 EXPECT_FALSE(write_callback_.have_result()); | 1360 EXPECT_FALSE(write_callback_.have_result()); |
1361 } | 1361 } |
1362 | 1362 |
1363 } // namespace net | 1363 } // namespace net |
OLD | NEW |