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

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

Issue 1901533002: Implementation of network level throttler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy transaction before session in QuicUploadWriteError. Created 4 years, 1 month 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/net.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 5 #include <memory>
6 #include <ostream> 6 #include <ostream>
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 // The non-alternate protocol job needs to hang in order to guarantee that 2576 // The non-alternate protocol job needs to hang in order to guarantee that
2577 // the alternate-protocol job will "win". 2577 // the alternate-protocol job will "win".
2578 AddHangingNonAlternateProtocolSocketData(); 2578 AddHangingNonAlternateProtocolSocketData();
2579 2579
2580 CreateSession(); 2580 CreateSession();
2581 request_.method = "POST"; 2581 request_.method = "POST";
2582 ChunkedUploadDataStream upload_data(0); 2582 ChunkedUploadDataStream upload_data(0);
2583 2583
2584 request_.upload_data_stream = &upload_data; 2584 request_.upload_data_stream = &upload_data;
2585 2585
2586 HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get()); 2586 std::unique_ptr<HttpNetworkTransaction> trans(
2587 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get()));
2587 TestCompletionCallback callback; 2588 TestCompletionCallback callback;
2588 int rv = trans.Start(&request_, callback.callback(), net_log_.bound()); 2589 int rv = trans->Start(&request_, callback.callback(), net_log_.bound());
2589 EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); 2590 EXPECT_THAT(rv, IsError(ERR_IO_PENDING));
2590 2591
2591 base::RunLoop().RunUntilIdle(); 2592 base::RunLoop().RunUntilIdle();
2592 upload_data.AppendData("1", 1, true); 2593 upload_data.AppendData("1", 1, true);
2593 base::RunLoop().RunUntilIdle(); 2594 base::RunLoop().RunUntilIdle();
2594 2595
2595 EXPECT_NE(OK, callback.WaitForResult()); 2596 EXPECT_NE(OK, callback.WaitForResult());
2597 trans.reset();
2596 session_.reset(); 2598 session_.reset();
2597 } 2599 }
2598 2600
2599 // Adds coverage to catch regression such as https://crbug.com/622043 2601 // Adds coverage to catch regression such as https://crbug.com/622043
2600 TEST_P(QuicNetworkTransactionTest, QuicServerPush) { 2602 TEST_P(QuicNetworkTransactionTest, QuicServerPush) {
2601 params_.origins_to_force_quic_on.insert( 2603 params_.origins_to_force_quic_on.insert(
2602 HostPortPair::FromString("mail.example.org:443")); 2604 HostPortPair::FromString("mail.example.org:443"));
2603 2605
2604 MockQuicData mock_quic_data; 2606 MockQuicData mock_quic_data;
2605 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( 2607 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
3274 AddHangingSocketData(); 3276 AddHangingSocketData();
3275 3277
3276 SendRequestAndExpectQuicResponse(origin1_); 3278 SendRequestAndExpectQuicResponse(origin1_);
3277 SendRequestAndExpectQuicResponse(origin2_); 3279 SendRequestAndExpectQuicResponse(origin2_);
3278 3280
3279 EXPECT_TRUE(AllDataConsumed()); 3281 EXPECT_TRUE(AllDataConsumed());
3280 } 3282 }
3281 3283
3282 } // namespace test 3284 } // namespace test
3283 } // namespace net 3285 } // namespace net
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698