| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic_http_stream.h" | 5 #include "net/quic/chromium/quic_http_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 SetRequest("POST", "/", DEFAULT_PRIORITY); | 948 SetRequest("POST", "/", DEFAULT_PRIORITY); |
| 949 size_t spdy_request_headers_frame_length; | 949 size_t spdy_request_headers_frame_length; |
| 950 AddWrite(ConstructRequestHeadersPacket(1, !kFin, DEFAULT_PRIORITY, | 950 AddWrite(ConstructRequestHeadersPacket(1, !kFin, DEFAULT_PRIORITY, |
| 951 &spdy_request_headers_frame_length)); | 951 &spdy_request_headers_frame_length)); |
| 952 AddWrite(ConstructClientDataPacket(2, kIncludeVersion, kFin, 0, kUploadData)); | 952 AddWrite(ConstructClientDataPacket(2, kIncludeVersion, kFin, 0, kUploadData)); |
| 953 AddWrite(ConstructClientAckPacket(3, 3, 1)); | 953 AddWrite(ConstructClientAckPacket(3, 3, 1)); |
| 954 | 954 |
| 955 Initialize(); | 955 Initialize(); |
| 956 | 956 |
| 957 std::vector<std::unique_ptr<UploadElementReader>> element_readers; | 957 std::vector<std::unique_ptr<UploadElementReader>> element_readers; |
| 958 element_readers.push_back(base::WrapUnique( | 958 element_readers.push_back(base::MakeUnique<UploadBytesElementReader>( |
| 959 new UploadBytesElementReader(kUploadData, strlen(kUploadData)))); | 959 kUploadData, strlen(kUploadData))); |
| 960 ElementsUploadDataStream upload_data_stream(std::move(element_readers), 0); | 960 ElementsUploadDataStream upload_data_stream(std::move(element_readers), 0); |
| 961 request_.method = "POST"; | 961 request_.method = "POST"; |
| 962 request_.url = GURL("http://www.example.org/"); | 962 request_.url = GURL("http://www.example.org/"); |
| 963 request_.upload_data_stream = &upload_data_stream; | 963 request_.upload_data_stream = &upload_data_stream; |
| 964 ASSERT_THAT( | 964 ASSERT_THAT( |
| 965 request_.upload_data_stream->Init(CompletionCallback(), BoundNetLog()), | 965 request_.upload_data_stream->Init(CompletionCallback(), BoundNetLog()), |
| 966 IsOk()); | 966 IsOk()); |
| 967 | 967 |
| 968 EXPECT_EQ(OK, | 968 EXPECT_EQ(OK, |
| 969 stream_->InitializeStream(&request_, DEFAULT_PRIORITY, | 969 stream_->InitializeStream(&request_, DEFAULT_PRIORITY, |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 EXPECT_TRUE(AtEof()); | 1953 EXPECT_TRUE(AtEof()); |
| 1954 | 1954 |
| 1955 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. | 1955 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. |
| 1956 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 1956 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
| 1957 stream_->GetTotalSentBytes()); | 1957 stream_->GetTotalSentBytes()); |
| 1958 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | 1958 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 } // namespace test | 1961 } // namespace test |
| 1962 } // namespace net | 1962 } // namespace net |
| OLD | NEW |