Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: net/quic/quic_http_stream_test.cc

Issue 1476443002: Remove ScopedVector from ElementsUploadDataStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698