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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 data_.reset( | 262 data_.reset( |
263 new SequencedSocketData(reads, reads_count, writes, writes_count)); | 263 new SequencedSocketData(reads, reads_count, writes, writes_count)); |
264 data_->set_connect_data(connect_data_); | 264 data_->set_connect_data(connect_data_); |
265 socket_factory_.AddSocketDataProvider(data_.get()); | 265 socket_factory_.AddSocketDataProvider(data_.get()); |
266 | 266 |
267 EXPECT_EQ(OK, | 267 EXPECT_EQ(OK, |
268 connection_.Init( | 268 connection_.Init( |
269 endpoint_.ToString(), tcp_params_, LOWEST, | 269 endpoint_.ToString(), tcp_params_, LOWEST, |
270 ClientSocketPool::RespectLimits::ENABLED, CompletionCallback(), | 270 ClientSocketPool::RespectLimits::ENABLED, CompletionCallback(), |
271 reinterpret_cast<TransportClientSocketPool*>(&socket_pool_), | 271 reinterpret_cast<TransportClientSocketPool*>(&socket_pool_), |
272 BoundNetLog())); | 272 NetLogWithSource())); |
273 sock_ = connection_.socket(); | 273 sock_ = connection_.socket(); |
274 } | 274 } |
275 | 275 |
276 void SequencedSocketDataTest::AssertSyncReadEquals(const char* data, int len) { | 276 void SequencedSocketDataTest::AssertSyncReadEquals(const char* data, int len) { |
277 // Issue the read, which will complete immediately. | 277 // Issue the read, which will complete immediately. |
278 AssertReadReturns(len, len); | 278 AssertReadReturns(len, len); |
279 AssertReadBufferEquals(data, len); | 279 AssertReadBufferEquals(data, len); |
280 } | 280 } |
281 | 281 |
282 void SequencedSocketDataTest::AssertAsyncReadEquals(const char* data, int len) { | 282 void SequencedSocketDataTest::AssertAsyncReadEquals(const char* data, int len) { |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 | 1247 |
1248 Resume(); | 1248 Resume(); |
1249 ASSERT_FALSE(IsPaused()); | 1249 ASSERT_FALSE(IsPaused()); |
1250 ASSERT_TRUE(write_callback_.have_result()); | 1250 ASSERT_TRUE(write_callback_.have_result()); |
1251 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); | 1251 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); |
1252 } | 1252 } |
1253 | 1253 |
1254 } // namespace | 1254 } // namespace |
1255 | 1255 |
1256 } // namespace net | 1256 } // namespace net |
OLD | NEW |