| 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 <string> | 6 #include <string> |
| 6 | 7 |
| 7 #include "base/macros.h" | 8 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 12 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
| 13 #include "net/socket/client_socket_handle.h" | 13 #include "net/socket/client_socket_handle.h" |
| 14 #include "net/socket/socket_test_util.h" | 14 #include "net/socket/socket_test_util.h" |
| 15 #include "net/socket/transport_client_socket_pool.h" | 15 #include "net/socket/transport_client_socket_pool.h" |
| 16 #include "testing/gtest/include/gtest/gtest-spi.h" | 16 #include "testing/gtest/include/gtest/gtest-spi.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "testing/platform_test.h" | 18 #include "testing/platform_test.h" |
| 19 | 19 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void set_expect_eof(bool expect_eof) { expect_eof_ = expect_eof; } | 206 void set_expect_eof(bool expect_eof) { expect_eof_ = expect_eof; } |
| 207 | 207 |
| 208 TestCompletionCallback read_callback_; | 208 TestCompletionCallback read_callback_; |
| 209 scoped_refptr<IOBuffer> read_buf_; | 209 scoped_refptr<IOBuffer> read_buf_; |
| 210 TestCompletionCallback write_callback_; | 210 TestCompletionCallback write_callback_; |
| 211 CompletionCallback failing_callback_; | 211 CompletionCallback failing_callback_; |
| 212 StreamSocket* sock_; | 212 StreamSocket* sock_; |
| 213 | 213 |
| 214 private: | 214 private: |
| 215 MockConnect connect_data_; | 215 MockConnect connect_data_; |
| 216 scoped_ptr<SequencedSocketData> data_; | 216 std::unique_ptr<SequencedSocketData> data_; |
| 217 | 217 |
| 218 const HostPortPair endpoint_; | 218 const HostPortPair endpoint_; |
| 219 scoped_refptr<TransportSocketParams> tcp_params_; | 219 scoped_refptr<TransportSocketParams> tcp_params_; |
| 220 MockClientSocketFactory socket_factory_; | 220 MockClientSocketFactory socket_factory_; |
| 221 MockTransportClientSocketPool socket_pool_; | 221 MockTransportClientSocketPool socket_pool_; |
| 222 ClientSocketHandle connection_; | 222 ClientSocketHandle connection_; |
| 223 bool expect_eof_; | 223 bool expect_eof_; |
| 224 | 224 |
| 225 DISALLOW_COPY_AND_ASSIGN(SequencedSocketDataTest); | 225 DISALLOW_COPY_AND_ASSIGN(SequencedSocketDataTest); |
| 226 }; | 226 }; |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 | 1241 |
| 1242 Resume(); | 1242 Resume(); |
| 1243 ASSERT_FALSE(IsPaused()); | 1243 ASSERT_FALSE(IsPaused()); |
| 1244 ASSERT_TRUE(write_callback_.have_result()); | 1244 ASSERT_TRUE(write_callback_.have_result()); |
| 1245 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); | 1245 ASSERT_EQ(kLen2, write_callback_.WaitForResult()); |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 } // namespace | 1248 } // namespace |
| 1249 | 1249 |
| 1250 } // namespace net | 1250 } // namespace net |
| OLD | NEW |