| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 OnHostResolutionCallback(), | 236 OnHostResolutionCallback(), |
| 237 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), | 237 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), |
| 238 socket_pool_(10, 10, &socket_factory_), | 238 socket_pool_(10, 10, &socket_factory_), |
| 239 expect_eof_(true) { | 239 expect_eof_(true) { |
| 240 } | 240 } |
| 241 | 241 |
| 242 SequencedSocketDataTest::~SequencedSocketDataTest() { | 242 SequencedSocketDataTest::~SequencedSocketDataTest() { |
| 243 // Make sure no unexpected pending tasks will cause a failure. | 243 // Make sure no unexpected pending tasks will cause a failure. |
| 244 base::RunLoop().RunUntilIdle(); | 244 base::RunLoop().RunUntilIdle(); |
| 245 if (expect_eof_) { | 245 if (expect_eof_) { |
| 246 EXPECT_EQ(expect_eof_, data_->at_read_eof()); | 246 EXPECT_EQ(expect_eof_, data_->AllReadDataConsumed()); |
| 247 EXPECT_EQ(expect_eof_, data_->at_write_eof()); | 247 EXPECT_EQ(expect_eof_, data_->AllWriteDataConsumed()); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 void SequencedSocketDataTest::Initialize(MockRead* reads, | 251 void SequencedSocketDataTest::Initialize(MockRead* reads, |
| 252 size_t reads_count, | 252 size_t reads_count, |
| 253 MockWrite* writes, | 253 MockWrite* writes, |
| 254 size_t writes_count) { | 254 size_t writes_count) { |
| 255 data_.reset( | 255 data_.reset( |
| 256 new SequencedSocketData(reads, reads_count, writes, writes_count)); | 256 new SequencedSocketData(reads, reads_count, writes, writes_count)); |
| 257 data_->set_connect_data(connect_data_); | 257 data_->set_connect_data(connect_data_); |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 | 1093 |
| 1094 ASSERT_EQ(ERR_IO_PENDING, | 1094 ASSERT_EQ(ERR_IO_PENDING, |
| 1095 sock_->Read(helper.read_buf().get(), kLen1, helper.callback())); | 1095 sock_->Read(helper.read_buf().get(), kLen1, helper.callback())); |
| 1096 | 1096 |
| 1097 base::MessageLoop::current()->RunUntilIdle(); | 1097 base::MessageLoop::current()->RunUntilIdle(); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 } // namespace | 1100 } // namespace |
| 1101 | 1101 |
| 1102 } // namespace net | 1102 } // namespace net |
| OLD | NEW |