OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/http/bidirectional_stream.h" | 5 #include "net/http/bidirectional_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const size_t kBodyDataSize = arraysize(kBodyData); | 45 const size_t kBodyDataSize = arraysize(kBodyData); |
46 // Size of the buffer to be allocated for each read. | 46 // Size of the buffer to be allocated for each read. |
47 const size_t kReadBufferSize = 4096; | 47 const size_t kReadBufferSize = 4096; |
48 | 48 |
49 // Delegate that reads data but does not send any data. | 49 // Delegate that reads data but does not send any data. |
50 class TestDelegateBase : public BidirectionalStream::Delegate { | 50 class TestDelegateBase : public BidirectionalStream::Delegate { |
51 public: | 51 public: |
52 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) | 52 TestDelegateBase(IOBuffer* read_buf, int read_buf_len) |
53 : TestDelegateBase(read_buf, | 53 : TestDelegateBase(read_buf, |
54 read_buf_len, | 54 read_buf_len, |
55 base::WrapUnique(new base::Timer(false, false))) {} | 55 base::MakeUnique<base::Timer>(false, false)) {} |
56 | 56 |
57 TestDelegateBase(IOBuffer* read_buf, | 57 TestDelegateBase(IOBuffer* read_buf, |
58 int read_buf_len, | 58 int read_buf_len, |
59 std::unique_ptr<base::Timer> timer) | 59 std::unique_ptr<base::Timer> timer) |
60 : read_buf_(read_buf), | 60 : read_buf_(read_buf), |
61 read_buf_len_(read_buf_len), | 61 read_buf_len_(read_buf_len), |
62 timer_(std::move(timer)), | 62 timer_(std::move(timer)), |
63 loop_(nullptr), | 63 loop_(nullptr), |
64 received_bytes_(0), | 64 received_bytes_(0), |
65 sent_bytes_(0), | 65 sent_bytes_(0), |
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 http_session_->http_server_properties()->GetAlternativeServices( | 1537 http_session_->http_server_properties()->GetAlternativeServices( |
1538 url::SchemeHostPort(default_url_)); | 1538 url::SchemeHostPort(default_url_)); |
1539 ASSERT_EQ(1u, alternative_service_vector.size()); | 1539 ASSERT_EQ(1u, alternative_service_vector.size()); |
1540 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), | 1540 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), |
1541 alternative_service_vector[0].protocol); | 1541 alternative_service_vector[0].protocol); |
1542 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); | 1542 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); |
1543 EXPECT_EQ(443, alternative_service_vector[0].port); | 1543 EXPECT_EQ(443, alternative_service_vector[0].port); |
1544 } | 1544 } |
1545 | 1545 |
1546 } // namespace net | 1546 } // namespace net |
OLD | NEW |