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

Side by Side Diff: net/tools/quic/quic_client_test.cc

Issue 2236973002: Landing Recent QUIC changes until 4AM, Aug 7, 2016 UTC-4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: flip quic_sequencer_buffer_retire_block_in_time to true 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/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_dispatcher.h » ('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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "net/tools/quic/quic_client.h" 5 #include "net/tools/quic/quic_client.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 25 matching lines...) Expand all
36 36
37 return number_of_open_fds; 37 return number_of_open_fds;
38 } 38 }
39 39
40 // Creates a new QuicClient and Initializes it. Caller is responsible for 40 // Creates a new QuicClient and Initializes it. Caller is responsible for
41 // deletion. 41 // deletion.
42 QuicClient* CreateAndInitializeQuicClient(EpollServer* eps, uint16_t port) { 42 QuicClient* CreateAndInitializeQuicClient(EpollServer* eps, uint16_t port) {
43 IPEndPoint server_address(IPEndPoint(net::test::Loopback4(), port)); 43 IPEndPoint server_address(IPEndPoint(net::test::Loopback4(), port));
44 QuicServerId server_id("hostname", server_address.port(), 44 QuicServerId server_id("hostname", server_address.port(),
45 PRIVACY_MODE_DISABLED); 45 PRIVACY_MODE_DISABLED);
46 QuicVersionVector versions = QuicSupportedVersions(); 46 QuicVersionVector versions = AllSupportedVersions();
47 QuicClient* client = 47 QuicClient* client =
48 new QuicClient(server_address, server_id, versions, eps, 48 new QuicClient(server_address, server_id, versions, eps,
49 CryptoTestUtils::ProofVerifierForTesting()); 49 CryptoTestUtils::ProofVerifierForTesting());
50 EXPECT_TRUE(client->Initialize()); 50 EXPECT_TRUE(client->Initialize());
51 return client; 51 return client;
52 } 52 }
53 53
54 TEST(QuicClientTest, DoNotLeakFDs) { 54 TEST(QuicClientTest, DoNotLeakFDs) {
55 // Create a ProofVerifier before counting the number of open FDs to work 55 // Create a ProofVerifier before counting the number of open FDs to work
56 // around some ASAN weirdness. 56 // around some ASAN weirdness.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Clean up UDP sockets. 98 // Clean up UDP sockets.
99 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); 99 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD());
100 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs()); 100 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs());
101 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); 101 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD());
102 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs()); 102 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs());
103 } 103 }
104 104
105 } // namespace 105 } // namespace
106 } // namespace test 106 } // namespace test
107 } // namespace net 107 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698