| Index: net/websockets/websocket_throttle_unittest.cc
|
| diff --git a/net/websockets/websocket_throttle_unittest.cc b/net/websockets/websocket_throttle_unittest.cc
|
| index 91d588f611f8283af92280a763dbcf43c40a1380..6c0dfbb2f69b411238aa76247d84a11a61b0ef54 100644
|
| --- a/net/websockets/websocket_throttle_unittest.cc
|
| +++ b/net/websockets/websocket_throttle_unittest.cc
|
| @@ -279,4 +279,29 @@ TEST_F(WebSocketThrottleTest, Throttle) {
|
| MessageLoopForIO::current()->RunAllPending();
|
| }
|
|
|
| +TEST_F(WebSocketThrottleTest, NoThrottleForDuplicateAddress) {
|
| + DummySocketStreamDelegate delegate;
|
| +
|
| + // For localhost: 127.0.0.1, 127.0.0.1
|
| + struct addrinfo* addr = AddAddr(127, 0, 0, 1, NULL);
|
| + addr = AddAddr(127, 0, 0, 1, addr);
|
| + scoped_refptr<WebSocketJob> w1 = new WebSocketJob(&delegate);
|
| + scoped_refptr<SocketStream> s1 =
|
| + new SocketStream(GURL("ws://localhost/"), w1.get());
|
| + w1->InitSocketStream(s1.get());
|
| + WebSocketThrottleTest::MockSocketStreamConnect(s1, addr);
|
| + DeleteAddrInfo(addr);
|
| +
|
| + DLOG(INFO) << "socket1";
|
| + TestCompletionCallback callback_s1;
|
| + // Trying to open connection to localhost will start without wait.
|
| + EXPECT_EQ(OK, w1->OnStartOpenConnection(s1, &callback_s1));
|
| +
|
| + DLOG(INFO) << "socket1 close";
|
| + w1->OnClose(s1.get());
|
| + s1->DetachDelegate();
|
| + DLOG(INFO) << "Done";
|
| + MessageLoopForIO::current()->RunAllPending();
|
| +}
|
| +
|
| }
|
|
|