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

Unified Diff: net/udp/udp_socket_unittest.cc

Issue 721273002: Remove timing limitation to set Broadcast, ReceiveBuffer, and SendBuffer options from UDPSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/udp/udp_socket_libevent.cc ('k') | net/udp/udp_socket_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_unittest.cc
diff --git a/net/udp/udp_socket_unittest.cc b/net/udp/udp_socket_unittest.cc
index 8282596b92cd9d666411dd2ca027d1be313f1226..c92bf2b35d100c4466a5ee262f2f1665bf065e46 100644
--- a/net/udp/udp_socket_unittest.cc
+++ b/net/udp/udp_socket_unittest.cc
@@ -353,7 +353,9 @@ TEST_F(UDPSocketTest, ConnectFail) {
base::Bind(&PrivilegedRand),
NULL,
NetLog::Source()));
- int rv = socket->Connect(peer_address);
+ int rv = socket->Open(peer_address.GetFamily());
+ EXPECT_EQ(OK, rv);
+ rv = socket->Connect(peer_address);
// Connect should have failed since we couldn't bind to that port,
EXPECT_NE(OK, rv);
// Make sure that UDPSocket actually closed the socket.
@@ -550,6 +552,7 @@ TEST_F(UDPSocketTest, MAYBE_JoinMulticastGroup) {
RandIntCallback(),
NULL,
NetLog::Source());
+ EXPECT_EQ(OK, socket.Open(bind_address.GetFamily()));
EXPECT_EQ(OK, socket.Bind(bind_address));
EXPECT_EQ(OK, socket.JoinGroup(group_ip));
// Joining group multiple times.
@@ -578,6 +581,7 @@ TEST_F(UDPSocketTest, MulticastOptions) {
EXPECT_NE(OK, socket.SetMulticastTimeToLive(-1));
EXPECT_EQ(OK, socket.SetMulticastInterface(0));
+ EXPECT_EQ(OK, socket.Open(bind_address.GetFamily()));
EXPECT_EQ(OK, socket.Bind(bind_address));
EXPECT_NE(OK, socket.SetMulticastLoopbackMode(false));
@@ -598,7 +602,10 @@ TEST_F(UDPSocketTest, SetDSCP) {
NetLog::Source());
// We need a real IP, but we won't actually send anything to it.
CreateUDPAddress("8.8.8.8", 9999, &bind_address);
- int rv = client.Connect(bind_address);
+ int rv = client.Open(bind_address.GetFamily());
+ EXPECT_EQ(OK, rv);
+
+ rv = client.Connect(bind_address);
if (rv != OK) {
// Let's try localhost then..
CreateUDPAddress("127.0.0.1", 9999, &bind_address);
@@ -705,6 +712,10 @@ TEST_F(UDPSocketTest, SetDSCPFake) {
NetLog::Source());
int rv = client.SetDiffServCodePoint(DSCP_AF41);
EXPECT_EQ(ERR_SOCKET_NOT_CONNECTED, rv);
+
+ rv = client.Open(bind_address.GetFamily());
+ EXPECT_EQ(OK, rv);
+
rv = client.Connect(bind_address);
EXPECT_EQ(OK, rv);
« no previous file with comments | « net/udp/udp_socket_libevent.cc ('k') | net/udp/udp_socket_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698