| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 const char kDefaultServerHostName[] = "www.google.com"; | 54 const char kDefaultServerHostName[] = "www.google.com"; |
| 55 const uint16_t kDefaultServerPort = 80; | 55 const uint16_t kDefaultServerPort = 80; |
| 56 // Size of the buffer to be allocated for each read. | 56 // Size of the buffer to be allocated for each read. |
| 57 const size_t kReadBufferSize = 4096; | 57 const size_t kReadBufferSize = 4096; |
| 58 | 58 |
| 59 class TestDelegateBase : public BidirectionalStreamImpl::Delegate { | 59 class TestDelegateBase : public BidirectionalStreamImpl::Delegate { |
| 60 public: | 60 public: |
| 61 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) | 61 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) |
| 62 : TestDelegateBase(read_buf, | 62 : TestDelegateBase(read_buf, |
| 63 read_buf_len, | 63 read_buf_len, |
| 64 base::WrapUnique(new base::Timer(false, false))) {} | 64 base::MakeUnique<base::Timer>(false, false)) {} |
| 65 | 65 |
| 66 TestDelegateBase(IOBuffer* read_buf, | 66 TestDelegateBase(IOBuffer* read_buf, |
| 67 int read_buf_len, | 67 int read_buf_len, |
| 68 std::unique_ptr<base::Timer> timer) | 68 std::unique_ptr<base::Timer> timer) |
| 69 : read_buf_(read_buf), | 69 : read_buf_(read_buf), |
| 70 read_buf_len_(read_buf_len), | 70 read_buf_len_(read_buf_len), |
| 71 timer_(std::move(timer)), | 71 timer_(std::move(timer)), |
| 72 loop_(nullptr), | 72 loop_(nullptr), |
| 73 next_proto_(kProtoUnknown), | 73 next_proto_(kProtoUnknown), |
| 74 received_bytes_(0), | 74 received_bytes_(0), |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 | 1629 |
| 1630 base::RunLoop().RunUntilIdle(); | 1630 base::RunLoop().RunUntilIdle(); |
| 1631 | 1631 |
| 1632 EXPECT_EQ(1, delegate->on_data_read_count()); | 1632 EXPECT_EQ(1, delegate->on_data_read_count()); |
| 1633 EXPECT_EQ(0, delegate->on_data_sent_count()); | 1633 EXPECT_EQ(0, delegate->on_data_sent_count()); |
| 1634 } | 1634 } |
| 1635 | 1635 |
| 1636 } // namespace test | 1636 } // namespace test |
| 1637 | 1637 |
| 1638 } // namespace net | 1638 } // namespace net |
| OLD | NEW |