OLD | NEW |
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 "ppapi/tests/test_tcp_server_socket_private.h" | 5 #include "ppapi/tests/test_tcp_server_socket_private.h" |
6 | 6 |
7 #include <cstdio> | 7 #include <cstdio> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ppapi/cpp/pass_ref.h" | 10 #include "ppapi/cpp/pass_ref.h" |
11 #include "ppapi/cpp/private/net_address_private.h" | 11 #include "ppapi/cpp/private/net_address_private.h" |
12 #include "ppapi/cpp/private/tcp_server_socket_private.h" | 12 #include "ppapi/cpp/private/tcp_server_socket_private.h" |
13 #include "ppapi/cpp/private/tcp_socket_private.h" | 13 #include "ppapi/cpp/private/tcp_socket_private.h" |
14 #include "ppapi/tests/test_utils.h" | 14 #include "ppapi/tests/test_utils.h" |
15 #include "ppapi/tests/testing_instance.h" | 15 #include "ppapi/tests/testing_instance.h" |
16 | 16 |
17 using pp::NetAddressPrivate; | 17 using pp::NetAddressPrivate; |
18 using pp::TCPServerSocketPrivate; | 18 using pp::TCPServerSocketPrivate; |
19 using pp::TCPSocketPrivate; | 19 using pp::TCPSocketPrivate; |
20 | 20 |
21 namespace { | |
22 | |
23 const uint16_t kPortScanFrom = 1024; | |
24 const uint16_t kPortScanTo = 4096; | |
25 | |
26 } // namespace | |
27 | |
28 REGISTER_TEST_CASE(TCPServerSocketPrivate); | 21 REGISTER_TEST_CASE(TCPServerSocketPrivate); |
29 | 22 |
30 TestTCPServerSocketPrivate::TestTCPServerSocketPrivate( | 23 TestTCPServerSocketPrivate::TestTCPServerSocketPrivate( |
31 TestingInstance* instance) : TestCase(instance) { | 24 TestingInstance* instance) : TestCase(instance) { |
32 } | 25 } |
33 | 26 |
34 bool TestTCPServerSocketPrivate::Init() { | 27 bool TestTCPServerSocketPrivate::Init() { |
35 bool tcp_server_socket_private_is_available = | 28 bool tcp_server_socket_private_is_available = |
36 TCPServerSocketPrivate::IsAvailable(); | 29 TCPServerSocketPrivate::IsAvailable(); |
37 if (!tcp_server_socket_private_is_available) { | 30 if (!tcp_server_socket_private_is_available) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 client_sockets[i]->Disconnect(); | 253 client_sockets[i]->Disconnect(); |
261 delete client_sockets[i]; | 254 delete client_sockets[i]; |
262 delete connect_callbacks[i]; | 255 delete connect_callbacks[i]; |
263 accepted_sockets[i]->Disconnect(); | 256 accepted_sockets[i]->Disconnect(); |
264 delete accepted_sockets[i]; | 257 delete accepted_sockets[i]; |
265 } | 258 } |
266 | 259 |
267 server_socket.StopListening(); | 260 server_socket.StopListening(); |
268 PASS(); | 261 PASS(); |
269 } | 262 } |
OLD | NEW |