| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/quic/chromium/bidirectional_stream_quic_impl.h" | 5 #include "net/quic/chromium/bidirectional_stream_quic_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const char kDefaultServerHostName[] = "www.google.com"; | 57 const char kDefaultServerHostName[] = "www.google.com"; |
| 58 const uint16_t kDefaultServerPort = 80; | 58 const uint16_t kDefaultServerPort = 80; |
| 59 // Size of the buffer to be allocated for each read. | 59 // Size of the buffer to be allocated for each read. |
| 60 const size_t kReadBufferSize = 4096; | 60 const size_t kReadBufferSize = 4096; |
| 61 | 61 |
| 62 class TestDelegateBase : public BidirectionalStreamImpl::Delegate { | 62 class TestDelegateBase : public BidirectionalStreamImpl::Delegate { |
| 63 public: | 63 public: |
| 64 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) | 64 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) |
| 65 : TestDelegateBase(read_buf, | 65 : TestDelegateBase(read_buf, |
| 66 read_buf_len, | 66 read_buf_len, |
| 67 base::MakeUnique<base::Timer>(false, false)) {} | 67 base::MakeUnique<base::OneShotTimer>()) {} |
| 68 | 68 |
| 69 TestDelegateBase(IOBuffer* read_buf, | 69 TestDelegateBase(IOBuffer* read_buf, |
| 70 int read_buf_len, | 70 int read_buf_len, |
| 71 std::unique_ptr<base::Timer> timer) | 71 std::unique_ptr<base::Timer> timer) |
| 72 : read_buf_(read_buf), | 72 : read_buf_(read_buf), |
| 73 read_buf_len_(read_buf_len), | 73 read_buf_len_(read_buf_len), |
| 74 timer_(std::move(timer)), | 74 timer_(std::move(timer)), |
| 75 loop_(nullptr), | 75 loop_(nullptr), |
| 76 next_proto_(kProtoUnknown), | 76 next_proto_(kProtoUnknown), |
| 77 received_bytes_(0), | 77 received_bytes_(0), |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 | 1816 |
| 1817 base::RunLoop().RunUntilIdle(); | 1817 base::RunLoop().RunUntilIdle(); |
| 1818 | 1818 |
| 1819 EXPECT_EQ(1, delegate->on_data_read_count()); | 1819 EXPECT_EQ(1, delegate->on_data_read_count()); |
| 1820 EXPECT_EQ(0, delegate->on_data_sent_count()); | 1820 EXPECT_EQ(0, delegate->on_data_sent_count()); |
| 1821 } | 1821 } |
| 1822 | 1822 |
| 1823 } // namespace test | 1823 } // namespace test |
| 1824 | 1824 |
| 1825 } // namespace net | 1825 } // namespace net |
| OLD | NEW |