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/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 TEST_P(QuicHttpStreamTest, SendPostRequest) { | 511 TEST_P(QuicHttpStreamTest, SendPostRequest) { |
512 SetRequest("POST", "/", DEFAULT_PRIORITY); | 512 SetRequest("POST", "/", DEFAULT_PRIORITY); |
513 size_t spdy_request_headers_frame_length; | 513 size_t spdy_request_headers_frame_length; |
514 AddWrite(ConstructRequestHeadersPacket(1, !kFin, DEFAULT_PRIORITY, | 514 AddWrite(ConstructRequestHeadersPacket(1, !kFin, DEFAULT_PRIORITY, |
515 &spdy_request_headers_frame_length)); | 515 &spdy_request_headers_frame_length)); |
516 AddWrite(ConstructDataPacket(2, kIncludeVersion, kFin, 0, kUploadData)); | 516 AddWrite(ConstructDataPacket(2, kIncludeVersion, kFin, 0, kUploadData)); |
517 AddWrite(ConstructAckPacket(3, 3, 1)); | 517 AddWrite(ConstructAckPacket(3, 3, 1)); |
518 | 518 |
519 Initialize(); | 519 Initialize(); |
520 | 520 |
521 ScopedVector<UploadElementReader> element_readers; | 521 std::vector<scoped_ptr<UploadElementReader>> element_readers; |
522 element_readers.push_back( | 522 element_readers.push_back(make_scoped_ptr( |
mmenke
2015/11/24 17:25:08
include scoped_ptr
| |
523 new UploadBytesElementReader(kUploadData, strlen(kUploadData))); | 523 new UploadBytesElementReader(kUploadData, strlen(kUploadData)))); |
524 ElementsUploadDataStream upload_data_stream(element_readers.Pass(), 0); | 524 ElementsUploadDataStream upload_data_stream(std::move(element_readers), 0); |
525 request_.method = "POST"; | 525 request_.method = "POST"; |
526 request_.url = GURL("http://www.google.com/"); | 526 request_.url = GURL("http://www.google.com/"); |
527 request_.upload_data_stream = &upload_data_stream; | 527 request_.upload_data_stream = &upload_data_stream; |
528 ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback())); | 528 ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback())); |
529 | 529 |
530 EXPECT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY, | 530 EXPECT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY, |
531 net_log_, callback_.callback())); | 531 net_log_, callback_.callback())); |
532 EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, | 532 EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, |
533 callback_.callback())); | 533 callback_.callback())); |
534 | 534 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
884 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 884 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
885 reliable_stream->EffectivePriority()); | 885 reliable_stream->EffectivePriority()); |
886 reliable_stream->SetDelegate(delegate); | 886 reliable_stream->SetDelegate(delegate); |
887 | 887 |
888 EXPECT_EQ(0, stream_->GetTotalSentBytes()); | 888 EXPECT_EQ(0, stream_->GetTotalSentBytes()); |
889 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | 889 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); |
890 } | 890 } |
891 | 891 |
892 } // namespace test | 892 } // namespace test |
893 } // namespace net | 893 } // namespace net |
OLD | NEW |