| OLD | NEW |
| 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 "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // around some ASAN weirdness. | 81 // around some ASAN weirdness. |
| 82 delete CryptoTestUtils::ProofVerifierForTesting(); | 82 delete CryptoTestUtils::ProofVerifierForTesting(); |
| 83 | 83 |
| 84 EpollServer eps; | 84 EpollServer eps; |
| 85 int number_of_open_fds = NumOpenFDs(); | 85 int number_of_open_fds = NumOpenFDs(); |
| 86 | 86 |
| 87 scoped_ptr<QuicClient> client( | 87 scoped_ptr<QuicClient> client( |
| 88 CreateAndInitializeQuicClient(&eps, net::test::kTestPort)); | 88 CreateAndInitializeQuicClient(&eps, net::test::kTestPort)); |
| 89 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs()); | 89 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs()); |
| 90 // Create more UDP sockets. | 90 // Create more UDP sockets. |
| 91 EXPECT_TRUE(QuicClientPeer::CreateUDPSocket(client.get())); | 91 EXPECT_TRUE(QuicClientPeer::CreateUDPSocketAndBind(client.get())); |
| 92 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs()); | 92 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs()); |
| 93 EXPECT_TRUE(QuicClientPeer::CreateUDPSocket(client.get())); | 93 EXPECT_TRUE(QuicClientPeer::CreateUDPSocketAndBind(client.get())); |
| 94 EXPECT_EQ(number_of_open_fds + 3, NumOpenFDs()); | 94 EXPECT_EQ(number_of_open_fds + 3, NumOpenFDs()); |
| 95 | 95 |
| 96 // Clean up UDP sockets. | 96 // Clean up UDP sockets. |
| 97 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); | 97 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); |
| 98 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs()); | 98 EXPECT_EQ(number_of_open_fds + 2, NumOpenFDs()); |
| 99 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); | 99 QuicClientPeer::CleanUpUDPSocket(client.get(), client->GetLatestFD()); |
| 100 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs()); | 100 EXPECT_EQ(number_of_open_fds + 1, NumOpenFDs()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace | 103 } // namespace |
| 104 } // namespace test | 104 } // namespace test |
| 105 } // namespace net | 105 } // namespace net |
| OLD | NEW |