| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socket/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ClientSocketPoolHistograms histograms_; | 61 ClientSocketPoolHistograms histograms_; |
| 62 DeterministicMockClientSocketFactory socket_factory_; | 62 DeterministicMockClientSocketFactory socket_factory_; |
| 63 MockTransportClientSocketPool socket_pool_; | 63 MockTransportClientSocketPool socket_pool_; |
| 64 ClientSocketHandle connection_; | 64 ClientSocketHandle connection_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest); | 66 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 DeterministicSocketDataTest::DeterministicSocketDataTest() | 69 DeterministicSocketDataTest::DeterministicSocketDataTest() |
| 70 : sock_(NULL), | 70 : sock_(NULL), |
| 71 data_(NULL), | |
| 72 read_buf_(NULL), | 71 read_buf_(NULL), |
| 73 connect_data_(SYNCHRONOUS, OK), | 72 connect_data_(SYNCHRONOUS, OK), |
| 74 endpoint_("www.google.com", 443), | 73 endpoint_("www.google.com", 443), |
| 75 tcp_params_(new TransportSocketParams(endpoint_, | 74 tcp_params_(new TransportSocketParams(endpoint_, |
| 76 LOWEST, | 75 LOWEST, |
| 77 false, | 76 false, |
| 78 false, | 77 false, |
| 79 OnHostResolutionCallback())), | 78 OnHostResolutionCallback())), |
| 80 histograms_(std::string()), | 79 histograms_(std::string()), |
| 81 socket_pool_(10, 10, &histograms_, &socket_factory_) {} | 80 socket_pool_(10, 10, &histograms_, &socket_factory_) {} |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 data_->StopAfter(1); | 612 data_->StopAfter(1); |
| 614 AssertSyncWriteEquals(kMsg3, kLen3); | 613 AssertSyncWriteEquals(kMsg3, kLen3); |
| 615 | 614 |
| 616 data_->RunFor(1); | 615 data_->RunFor(1); |
| 617 ASSERT_TRUE(read_callback_.have_result()); | 616 ASSERT_TRUE(read_callback_.have_result()); |
| 618 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); | 617 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); |
| 619 AssertReadBufferEquals(kMsg2, kLen2); | 618 AssertReadBufferEquals(kMsg2, kLen2); |
| 620 } | 619 } |
| 621 | 620 |
| 622 } // namespace net | 621 } // namespace net |
| OLD | NEW |