| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 OnHostResolutionCallback(), | 235 OnHostResolutionCallback(), |
| 236 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), | 236 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), |
| 237 socket_pool_(10, 10, &socket_factory_), | 237 socket_pool_(10, 10, &socket_factory_), |
| 238 expect_eof_(true) { | 238 expect_eof_(true) { |
| 239 } | 239 } |
| 240 | 240 |
| 241 SequencedSocketDataTest::~SequencedSocketDataTest() { | 241 SequencedSocketDataTest::~SequencedSocketDataTest() { |
| 242 // Make sure no unexpected pending tasks will cause a failure. | 242 // Make sure no unexpected pending tasks will cause a failure. |
| 243 base::RunLoop().RunUntilIdle(); | 243 base::RunLoop().RunUntilIdle(); |
| 244 if (expect_eof_) { | 244 if (expect_eof_) { |
| 245 EXPECT_EQ(expect_eof_, data_->at_read_eof()); | 245 EXPECT_EQ(expect_eof_, data_->AllReadDataConsumed()); |
| 246 EXPECT_EQ(expect_eof_, data_->at_write_eof()); | 246 EXPECT_EQ(expect_eof_, data_->AllWriteDataConsumed()); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 void SequencedSocketDataTest::Initialize(MockRead* reads, | 250 void SequencedSocketDataTest::Initialize(MockRead* reads, |
| 251 size_t reads_count, | 251 size_t reads_count, |
| 252 MockWrite* writes, | 252 MockWrite* writes, |
| 253 size_t writes_count) { | 253 size_t writes_count) { |
| 254 data_.reset( | 254 data_.reset( |
| 255 new SequencedSocketData(reads, reads_count, writes, writes_count)); | 255 new SequencedSocketData(reads, reads_count, writes, writes_count)); |
| 256 data_->set_connect_data(connect_data_); | 256 data_->set_connect_data(connect_data_); |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 | 1066 |
| 1067 ASSERT_EQ(ERR_IO_PENDING, | 1067 ASSERT_EQ(ERR_IO_PENDING, |
| 1068 sock_->Read(helper.read_buf().get(), kLen1, helper.callback())); | 1068 sock_->Read(helper.read_buf().get(), kLen1, helper.callback())); |
| 1069 | 1069 |
| 1070 base::MessageLoop::current()->RunUntilIdle(); | 1070 base::MessageLoop::current()->RunUntilIdle(); |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 } // namespace | 1073 } // namespace |
| 1074 | 1074 |
| 1075 } // namespace net | 1075 } // namespace net |
| OLD | NEW |