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 "net/udp/udp_socket.h" | 5 #include "net/udp/udp_socket.h" |
6 | 6 |
7 #include "net/udp/udp_client_socket.h" | 7 #include "net/udp/udp_client_socket.h" |
8 #include "net/udp/udp_server_socket.h" | 8 #include "net/udp/udp_server_socket.h" |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 bool may_fail; | 434 bool may_fail; |
435 } tests[] = { | 435 } tests[] = { |
436 { "127.0.00.1", "127.0.0.1", false }, | 436 { "127.0.00.1", "127.0.0.1", false }, |
437 { "::1", "::1", true }, | 437 { "::1", "::1", true }, |
438 #if !defined(OS_ANDROID) | 438 #if !defined(OS_ANDROID) |
439 // Addresses below are disabled on Android. See crbug.com/161248 | 439 // Addresses below are disabled on Android. See crbug.com/161248 |
440 { "192.168.1.1", "127.0.0.1", false }, | 440 { "192.168.1.1", "127.0.0.1", false }, |
441 { "2001:db8:0::42", "::1", true }, | 441 { "2001:db8:0::42", "::1", true }, |
442 #endif | 442 #endif |
443 }; | 443 }; |
444 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) { | 444 for (size_t i = 0; i < arraysize(tests); i++) { |
445 SCOPED_TRACE(std::string("Connecting from ") + tests[i].local_address + | 445 SCOPED_TRACE(std::string("Connecting from ") + tests[i].local_address + |
446 std::string(" to ") + tests[i].remote_address); | 446 std::string(" to ") + tests[i].remote_address); |
447 | 447 |
448 IPAddressNumber ip_number; | 448 IPAddressNumber ip_number; |
449 ParseIPLiteralToNumber(tests[i].remote_address, &ip_number); | 449 ParseIPLiteralToNumber(tests[i].remote_address, &ip_number); |
450 IPEndPoint remote_address(ip_number, 80); | 450 IPEndPoint remote_address(ip_number, 80); |
451 ParseIPLiteralToNumber(tests[i].local_address, &ip_number); | 451 ParseIPLiteralToNumber(tests[i].local_address, &ip_number); |
452 IPEndPoint local_address(ip_number, 80); | 452 IPEndPoint local_address(ip_number, 80); |
453 | 453 |
454 UDPClientSocket client(DatagramSocket::DEFAULT_BIND, | 454 UDPClientSocket client(DatagramSocket::DEFAULT_BIND, |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 g_expected_traffic_type = QOSTrafficTypeExcellentEffort; | 732 g_expected_traffic_type = QOSTrafficTypeExcellentEffort; |
733 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_NO_CHANGE)); | 733 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_NO_CHANGE)); |
734 g_expected_dscp = DSCP_DEFAULT; | 734 g_expected_dscp = DSCP_DEFAULT; |
735 g_expected_traffic_type = QOSTrafficTypeBestEffort; | 735 g_expected_traffic_type = QOSTrafficTypeBestEffort; |
736 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_DEFAULT)); | 736 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_DEFAULT)); |
737 client.Close(); | 737 client.Close(); |
738 } | 738 } |
739 #endif | 739 #endif |
740 | 740 |
741 } // namespace net | 741 } // namespace net |
OLD | NEW |