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

Unified Diff: net/tools/quic/quic_client_test.cc

Issue 1411063004: Remove insecure QUIC support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enough! Created 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_test.cc
diff --git a/net/tools/quic/quic_client_test.cc b/net/tools/quic/quic_client_test.cc
index e3a7270536f63e9a3972371110ce14c1a27b0ad7..8235dcecd2fbbf14f4d76a7c84f1d7aca6b041c7 100644
--- a/net/tools/quic/quic_client_test.cc
+++ b/net/tools/quic/quic_client_test.cc
@@ -9,11 +9,13 @@
#include "base/basictypes.h"
#include "base/strings/string_util.h"
+#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/tools/epoll_server/epoll_server.h"
#include "testing/gtest/include/gtest/gtest.h"
using net::EpollServer;
+using net::test::CryptoTestUtils;
namespace net {
namespace tools {
@@ -38,15 +40,21 @@ int NumOpenFDs() {
// deletion.
QuicClient* CreateAndInitializeQuicClient(EpollServer* eps, uint16 port) {
IPEndPoint server_address(IPEndPoint(net::test::Loopback4(), port));
- QuicServerId server_id("hostname", server_address.port(), false,
+ QuicServerId server_id("hostname", server_address.port(),
PRIVACY_MODE_DISABLED);
QuicVersionVector versions = QuicSupportedVersions();
- QuicClient* client = new QuicClient(server_address, server_id, versions, eps);
+ QuicClient* client =
+ new QuicClient(server_address, server_id, versions, eps,
+ CryptoTestUtils::ProofVerifierForTesting());
EXPECT_TRUE(client->Initialize());
return client;
}
TEST(QuicClientTest, DoNotLeakFDs) {
+ // Create a ProofVerifier before counting the number of open FDs to work
+ // around some ASAN weirdness.
+ delete CryptoTestUtils::ProofVerifierForTesting();
+
// Make sure that the QuicClient doesn't leak FDs. Doing so could cause port
// exhaustion in long running processes which repeatedly create clients.
@@ -56,7 +64,7 @@ TEST(QuicClientTest, DoNotLeakFDs) {
// Create a number of clients, initialize them, and verify this has resulted
// in additional FDs being opened.
- const int kNumClients = 5;
+ const int kNumClients = 50;
for (int i = 0; i < kNumClients; ++i) {
scoped_ptr<QuicClient> client(
CreateAndInitializeQuicClient(&eps, net::test::kTestPort + i));
« 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