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

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

Issue 2227503003: Add net log to UploadDataStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 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
« no previous file with comments | « net/quic/chromium/quic_http_stream_test.cc ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void InitializePostRequest(size_t length) { 231 void InitializePostRequest(size_t length) {
232 GenerateBody(length); 232 GenerateBody(length);
233 std::vector<std::unique_ptr<UploadElementReader>> element_readers; 233 std::vector<std::unique_ptr<UploadElementReader>> element_readers;
234 element_readers.push_back(base::WrapUnique(new UploadBytesElementReader( 234 element_readers.push_back(base::WrapUnique(new UploadBytesElementReader(
235 request_body_.data(), request_body_.length()))); 235 request_body_.data(), request_body_.length())));
236 upload_data_stream_.reset( 236 upload_data_stream_.reset(
237 new ElementsUploadDataStream(std::move(element_readers), 0)); 237 new ElementsUploadDataStream(std::move(element_readers), 0));
238 request_.method = "POST"; 238 request_.method = "POST";
239 request_.url = GURL("https://test.example.com/"); 239 request_.url = GURL("https://test.example.com/");
240 request_.upload_data_stream = upload_data_stream_.get(); 240 request_.upload_data_stream = upload_data_stream_.get();
241 ASSERT_THAT(request_.upload_data_stream->Init(CompletionCallback()), 241 ASSERT_THAT(
242 IsOk()); 242 request_.upload_data_stream->Init(CompletionCallback(), BoundNetLog()),
243 IsOk());
243 } 244 }
244 245
245 // Checks that |consumer| completed and received |status_line| and |body|. 246 // Checks that |consumer| completed and received |status_line| and |body|.
246 void CheckResponse(const TestTransactionConsumer& consumer, 247 void CheckResponse(const TestTransactionConsumer& consumer,
247 const std::string& status_line, 248 const std::string& status_line,
248 const std::string& body) { 249 const std::string& body) {
249 ASSERT_TRUE(consumer.is_done()); 250 ASSERT_TRUE(consumer.is_done());
250 ASSERT_THAT(consumer.error(), IsOk()); 251 ASSERT_THAT(consumer.error(), IsOk());
251 EXPECT_EQ(status_line, consumer.response_info()->headers->GetStatusLine()); 252 EXPECT_EQ(status_line, consumer.response_info()->headers->GetStatusLine());
252 EXPECT_EQ(body, consumer.content()); 253 EXPECT_EQ(body, consumer.content());
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 base::RunLoop().Run(); 383 base::RunLoop().Run();
383 384
384 for (size_t i = 0; i < num_requests; ++i) { 385 for (size_t i = 0; i < num_requests; ++i) {
385 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody); 386 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody);
386 } 387 }
387 base::STLDeleteElements(&consumers); 388 base::STLDeleteElements(&consumers);
388 } 389 }
389 390
390 } // namespace test 391 } // namespace test
391 } // namespace net 392 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_http_stream_test.cc ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698