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

Side by Side Diff: net/socket/udp_socket_unittest.cc

Issue 2809993003: ServerSetDoNotFragment skip IPv6 on ERR_ADDRESS_UNREACHABLE. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | 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) 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/socket/udp_socket.h" 5 #include "net/socket/udp_socket.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 600
601 TEST_F(UDPSocketTest, ServerSetDoNotFragment) { 601 TEST_F(UDPSocketTest, ServerSetDoNotFragment) {
602 for (std::string ip : {"127.0.0.1", "::1"}) { 602 for (std::string ip : {"127.0.0.1", "::1"}) {
603 LOG(INFO) << "ip: " << ip; 603 LOG(INFO) << "ip: " << ip;
604 IPEndPoint bind_address; 604 IPEndPoint bind_address;
605 CreateUDPAddress(ip, 0, &bind_address); 605 CreateUDPAddress(ip, 0, &bind_address);
606 UDPServerSocket server(nullptr, NetLogSource()); 606 UDPServerSocket server(nullptr, NetLogSource());
607 int rv = server.Listen(bind_address); 607 int rv = server.Listen(bind_address);
608 // May fail on IPv6 is IPv6 is not configure 608 // May fail on IPv6 is IPv6 is not configure
609 if (bind_address.address().IsIPv6() && rv == ERR_ADDRESS_INVALID) 609 if (bind_address.address().IsIPv6() &&
610 (rv == ERR_ADDRESS_INVALID || rv == ERR_ADDRESS_UNREACHABLE))
610 return; 611 return;
611 EXPECT_THAT(rv, IsOk()); 612 EXPECT_THAT(rv, IsOk());
612 613
613 #if defined(OS_MACOSX) 614 #if defined(OS_MACOSX)
614 EXPECT_EQ(ERR_NOT_IMPLEMENTED, server.SetDoNotFragment()); 615 EXPECT_EQ(ERR_NOT_IMPLEMENTED, server.SetDoNotFragment());
615 #else 616 #else
616 rv = server.SetDoNotFragment(); 617 rv = server.SetDoNotFragment();
617 EXPECT_THAT(rv, IsOk()); 618 EXPECT_THAT(rv, IsOk());
618 #endif 619 #endif
619 } 620 }
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 g_expected_traffic_type = QOSTrafficTypeExcellentEffort; 890 g_expected_traffic_type = QOSTrafficTypeExcellentEffort;
890 EXPECT_THAT(client.SetDiffServCodePoint(DSCP_NO_CHANGE), IsOk()); 891 EXPECT_THAT(client.SetDiffServCodePoint(DSCP_NO_CHANGE), IsOk());
891 g_expected_dscp = DSCP_DEFAULT; 892 g_expected_dscp = DSCP_DEFAULT;
892 g_expected_traffic_type = QOSTrafficTypeBestEffort; 893 g_expected_traffic_type = QOSTrafficTypeBestEffort;
893 EXPECT_THAT(client.SetDiffServCodePoint(DSCP_DEFAULT), IsOk()); 894 EXPECT_THAT(client.SetDiffServCodePoint(DSCP_DEFAULT), IsOk());
894 client.Close(); 895 client.Close();
895 } 896 }
896 #endif 897 #endif
897 898
898 } // namespace net 899 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698