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

Side by Side Diff: third_party/crashpad/crashpad/util/net/http_transport_test.cc

Issue 2555353002: Update Crashpad to 32981a3ee9d7c2769fb27afa038fe2e194cfa329 (Closed)
Patch Set: fix readme Created 4 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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 HTTPHeaders headers; 272 HTTPHeaders headers;
273 headers[kContentType] = kTextPlain; 273 headers[kContentType] = kTextPlain;
274 headers[kContentLength] = base::StringPrintf("%" PRIuS, strlen(kTextBody)); 274 headers[kContentLength] = base::StringPrintf("%" PRIuS, strlen(kTextBody));
275 275
276 HTTPTransportTestFixture test( 276 HTTPTransportTestFixture test(
277 headers, std::move(body_stream), 200, &UnchunkedPlainText); 277 headers, std::move(body_stream), 200, &UnchunkedPlainText);
278 test.Run(); 278 test.Run();
279 } 279 }
280 280
281 void RunUpload33k(bool has_content_length) { 281 void RunUpload33k(bool has_content_length) {
282 // On OS X, NSMutableURLRequest winds up calling into a CFReadStream’s Read() 282 // On macOS, NSMutableURLRequest winds up calling into a CFReadStream’s Read()
283 // callback with a 32kB buffer. Make sure that it’s able to get everything 283 // callback with a 32kB buffer. Make sure that it’s able to get everything
284 // when enough is available to fill this buffer, requiring more than one 284 // when enough is available to fill this buffer, requiring more than one
285 // Read(). 285 // Read().
286 286
287 std::string request_string(33 * 1024, 'a'); 287 std::string request_string(33 * 1024, 'a');
288 std::unique_ptr<HTTPBodyStream> body_stream( 288 std::unique_ptr<HTTPBodyStream> body_stream(
289 new StringHTTPBodyStream(request_string)); 289 new StringHTTPBodyStream(request_string));
290 290
291 HTTPHeaders headers; 291 HTTPHeaders headers;
292 headers[kContentType] = "application/octet-stream"; 292 headers[kContentType] = "application/octet-stream";
(...skipping 17 matching lines...) Expand all
310 } 310 }
311 311
312 TEST(HTTPTransport, Upload33k_LengthUnknown) { 312 TEST(HTTPTransport, Upload33k_LengthUnknown) {
313 // The same as Upload33k, but without declaring Content-Length ahead of time. 313 // The same as Upload33k, but without declaring Content-Length ahead of time.
314 RunUpload33k(false); 314 RunUpload33k(false);
315 } 315 }
316 316
317 } // namespace 317 } // namespace
318 } // namespace test 318 } // namespace test
319 } // namespace crashpad 319 } // namespace crashpad
OLDNEW
« no previous file with comments | « third_party/crashpad/crashpad/util/net/http_transport.h ('k') | third_party/crashpad/crashpad/util/posix/close_multiple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698