| 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 25 matching lines...) Expand all Loading... |
| 36 void AssertAsyncReadEquals(const char* data, int len); | 36 void AssertAsyncReadEquals(const char* data, int len); |
| 37 void AssertReadReturns(const char* data, int len, int rv); | 37 void AssertReadReturns(const char* data, int len, int rv); |
| 38 void AssertReadBufferEquals(const char* data, int len); | 38 void AssertReadBufferEquals(const char* data, int len); |
| 39 | 39 |
| 40 void AssertSyncWriteEquals(const char* data, int len); | 40 void AssertSyncWriteEquals(const char* data, int len); |
| 41 void AssertAsyncWriteEquals(const char* data, int len); | 41 void AssertAsyncWriteEquals(const char* data, int len); |
| 42 void AssertWriteReturns(const char* data, int len, int rv); | 42 void AssertWriteReturns(const char* data, int len, int rv); |
| 43 | 43 |
| 44 TestCompletionCallback read_callback_; | 44 TestCompletionCallback read_callback_; |
| 45 TestCompletionCallback write_callback_; | 45 TestCompletionCallback write_callback_; |
| 46 ClientSocket* sock_; | 46 StreamSocket* sock_; |
| 47 scoped_refptr<DeterministicSocketData> data_; | 47 scoped_refptr<DeterministicSocketData> data_; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 scoped_refptr<IOBuffer> read_buf_; | 50 scoped_refptr<IOBuffer> read_buf_; |
| 51 MockConnect connect_data_; | 51 MockConnect connect_data_; |
| 52 | 52 |
| 53 GURL url_; | 53 GURL url_; |
| 54 HostPortPair endpoint_; | 54 HostPortPair endpoint_; |
| 55 scoped_refptr<TransportSocketParams> tcp_params_; | 55 scoped_refptr<TransportSocketParams> tcp_params_; |
| 56 ClientSocketPoolHistograms histograms_; | 56 ClientSocketPoolHistograms histograms_; |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // Issue the writes which will complete immediately | 528 // Issue the writes which will complete immediately |
| 529 data_->StopAfter(1); | 529 data_->StopAfter(1); |
| 530 AssertSyncWriteEquals(kMsg3, kLen3); | 530 AssertSyncWriteEquals(kMsg3, kLen3); |
| 531 | 531 |
| 532 data_->RunFor(1); | 532 data_->RunFor(1); |
| 533 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); | 533 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); |
| 534 AssertReadBufferEquals(kMsg2, kLen2); | 534 AssertReadBufferEquals(kMsg2, kLen2); |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace net | 537 } // namespace net |
| OLD | NEW |