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

Side by Side Diff: net/quic/chromium/quic_end_to_end_unittest.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <memory> 5 #include <memory>
6 #include <ostream> 6 #include <ostream>
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 request_body_.reserve(length); 205 request_body_.reserve(length);
206 for (size_t i = 0; i < length; ++i) { 206 for (size_t i = 0; i < length; ++i) {
207 request_body_.append(1, static_cast<char>(32 + i % (126 - 32))); 207 request_body_.append(1, static_cast<char>(32 + i % (126 - 32)));
208 } 208 }
209 } 209 }
210 210
211 // Initializes |request_| for a post of |length| bytes. 211 // Initializes |request_| for a post of |length| bytes.
212 void InitializePostRequest(size_t length) { 212 void InitializePostRequest(size_t length) {
213 GenerateBody(length); 213 GenerateBody(length);
214 std::vector<std::unique_ptr<UploadElementReader>> element_readers; 214 std::vector<std::unique_ptr<UploadElementReader>> element_readers;
215 element_readers.push_back(base::WrapUnique(new UploadBytesElementReader( 215 element_readers.push_back(base::MakeUnique<UploadBytesElementReader>(
216 request_body_.data(), request_body_.length()))); 216 request_body_.data(), request_body_.length()));
217 upload_data_stream_.reset( 217 upload_data_stream_.reset(
218 new ElementsUploadDataStream(std::move(element_readers), 0)); 218 new ElementsUploadDataStream(std::move(element_readers), 0));
219 request_.method = "POST"; 219 request_.method = "POST";
220 request_.url = GURL("https://test.example.com/"); 220 request_.url = GURL("https://test.example.com/");
221 request_.upload_data_stream = upload_data_stream_.get(); 221 request_.upload_data_stream = upload_data_stream_.get();
222 ASSERT_THAT( 222 ASSERT_THAT(
223 request_.upload_data_stream->Init(CompletionCallback(), BoundNetLog()), 223 request_.upload_data_stream->Init(CompletionCallback(), BoundNetLog()),
224 IsOk()); 224 IsOk());
225 } 225 }
226 226
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 base::RunLoop().Run(); 364 base::RunLoop().Run();
365 365
366 for (size_t i = 0; i < num_requests; ++i) { 366 for (size_t i = 0; i < num_requests; ++i) {
367 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody); 367 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody);
368 } 368 }
369 base::STLDeleteElements(&consumers); 369 base::STLDeleteElements(&consumers);
370 } 370 }
371 371
372 } // namespace test 372 } // namespace test
373 } // namespace net 373 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.cc ('k') | net/quic/chromium/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698