| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/platform_test.h" | 7 #include "testing/platform_test.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 //----------------------------------------------------------------------------- | 10 //----------------------------------------------------------------------------- |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 MockTransportClientSocketPool socket_pool_; | 57 MockTransportClientSocketPool socket_pool_; |
| 58 ClientSocketHandle connection_; | 58 ClientSocketHandle connection_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest); | 60 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 DeterministicSocketDataTest::DeterministicSocketDataTest() | 63 DeterministicSocketDataTest::DeterministicSocketDataTest() |
| 64 : sock_(NULL), | 64 : sock_(NULL), |
| 65 data_(NULL), | 65 data_(NULL), |
| 66 read_buf_(NULL), | 66 read_buf_(NULL), |
| 67 connect_data_(false, OK), | 67 connect_data_(SYNCHRONOUS, OK), |
| 68 endpoint_("www.google.com", 443), | 68 endpoint_("www.google.com", 443), |
| 69 tcp_params_(new TransportSocketParams(endpoint_, | 69 tcp_params_(new TransportSocketParams(endpoint_, |
| 70 LOWEST, | 70 LOWEST, |
| 71 false, | 71 false, |
| 72 false)), | 72 false)), |
| 73 histograms_(""), | 73 histograms_(""), |
| 74 socket_pool_(10, 10, &histograms_, &socket_factory_) { | 74 socket_pool_(10, 10, &histograms_, &socket_factory_) { |
| 75 } | 75 } |
| 76 | 76 |
| 77 void DeterministicSocketDataTest::TearDown() { | 77 void DeterministicSocketDataTest::TearDown() { |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 // Issue the writes which will complete immediately | 523 // Issue the writes which will complete immediately |
| 524 data_->StopAfter(1); | 524 data_->StopAfter(1); |
| 525 AssertSyncWriteEquals(kMsg3, kLen3); | 525 AssertSyncWriteEquals(kMsg3, kLen3); |
| 526 | 526 |
| 527 data_->RunFor(1); | 527 data_->RunFor(1); |
| 528 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); | 528 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); |
| 529 AssertReadBufferEquals(kMsg2, kLen2); | 529 AssertReadBufferEquals(kMsg2, kLen2); |
| 530 } | 530 } |
| 531 | 531 |
| 532 } // namespace net | 532 } // namespace net |
| OLD | NEW |