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

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

Issue 2417183003: Remove stl_util's deletion functions from remaining quic code. (Closed)
Patch Set: rebase Created 4 years, 2 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"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/stl_util.h"
14 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
15 #include "net/base/elements_upload_data_stream.h" 14 #include "net/base/elements_upload_data_stream.h"
16 #include "net/base/ip_address.h" 15 #include "net/base/ip_address.h"
17 #include "net/base/test_completion_callback.h" 16 #include "net/base/test_completion_callback.h"
18 #include "net/base/upload_bytes_element_reader.h" 17 #include "net/base/upload_bytes_element_reader.h"
19 #include "net/base/upload_data_stream.h" 18 #include "net/base/upload_data_stream.h"
20 #include "net/cert/ct_policy_enforcer.h" 19 #include "net/cert/ct_policy_enforcer.h"
21 #include "net/cert/mock_cert_verifier.h" 20 #include "net/cert/mock_cert_verifier.h"
22 #include "net/cert/multi_log_ct_verifier.h" 21 #include "net/cert/multi_log_ct_verifier.h"
23 #include "net/dns/mapped_host_resolver.h" 22 #include "net/dns/mapped_host_resolver.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 #if defined(THREAD_SANITIZER) 344 #if defined(THREAD_SANITIZER)
346 TEST_P(QuicEndToEndTest, DISABLED_UberTest) { 345 TEST_P(QuicEndToEndTest, DISABLED_UberTest) {
347 #else 346 #else
348 TEST_P(QuicEndToEndTest, UberTest) { 347 TEST_P(QuicEndToEndTest, UberTest) {
349 #endif 348 #endif
350 // FLAGS_fake_packet_loss_percentage = 30; 349 // FLAGS_fake_packet_loss_percentage = 30;
351 350
352 const char kResponseBody[] = "some really big response body"; 351 const char kResponseBody[] = "some really big response body";
353 AddToCache(request_.url.PathForRequest(), 200, "OK", kResponseBody); 352 AddToCache(request_.url.PathForRequest(), 200, "OK", kResponseBody);
354 353
355 std::vector<TestTransactionConsumer*> consumers; 354 std::vector<std::unique_ptr<TestTransactionConsumer>> consumers;
356 size_t num_requests = 100; 355 for (size_t i = 0; i < 100; ++i) {
357 for (size_t i = 0; i < num_requests; ++i) {
358 TestTransactionConsumer* consumer = new TestTransactionConsumer( 356 TestTransactionConsumer* consumer = new TestTransactionConsumer(
359 DEFAULT_PRIORITY, transaction_factory_.get()); 357 DEFAULT_PRIORITY, transaction_factory_.get());
360 consumers.push_back(consumer); 358 consumers.push_back(base::WrapUnique(consumer));
361 consumer->Start(&request_, NetLogWithSource()); 359 consumer->Start(&request_, NetLogWithSource());
362 } 360 }
363 361
364 // Will terminate when the last consumer completes. 362 // Will terminate when the last consumer completes.
365 base::RunLoop().Run(); 363 base::RunLoop().Run();
366 364
367 for (size_t i = 0; i < num_requests; ++i) { 365 for (const auto& consumer : consumers)
368 CheckResponse(*consumers[i], "HTTP/1.1 200", kResponseBody); 366 CheckResponse(*consumer.get(), "HTTP/1.1 200", kResponseBody);
369 }
370 base::STLDeleteElements(&consumers);
371 } 367 }
372 368
373 } // namespace test 369 } // namespace test
374 } // namespace net 370 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/crypto/proof_verifier_chromium.cc ('k') | net/quic/chromium/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698