| Index: trunk/src/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc
|
| ===================================================================
|
| --- trunk/src/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc (revision 252899)
|
| +++ trunk/src/content/browser/renderer_host/p2p/socket_host_udp_unittest.cc (working copy)
|
| @@ -217,18 +217,17 @@
|
| .Times(3)
|
| .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));
|
|
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet1;
|
| CreateStunRequest(&packet1);
|
| - socket_host_->Send(dest1_, packet1, options, 0);
|
| + socket_host_->Send(dest1_, packet1, net::DSCP_NO_CHANGE, 0);
|
|
|
| std::vector<char> packet2;
|
| CreateStunResponse(&packet2);
|
| - socket_host_->Send(dest1_, packet2, options, 0);
|
| + socket_host_->Send(dest1_, packet2, net::DSCP_NO_CHANGE, 0);
|
|
|
| std::vector<char> packet3;
|
| CreateStunError(&packet3);
|
| - socket_host_->Send(dest1_, packet3, options, 0);
|
| + socket_host_->Send(dest1_, packet3, net::DSCP_NO_CHANGE, 0);
|
|
|
| ASSERT_EQ(sent_packets_.size(), 3U);
|
| ASSERT_EQ(sent_packets_[0].second, packet1);
|
| @@ -243,10 +242,9 @@
|
| MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID))))
|
| .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
|
|
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet;
|
| CreateRandomPacket(&packet);
|
| - socket_host_->Send(dest1_, packet, options, 0);
|
| + socket_host_->Send(dest1_, packet, net::DSCP_NO_CHANGE, 0);
|
|
|
| ASSERT_EQ(sent_packets_.size(), 0U);
|
| }
|
| @@ -266,11 +264,9 @@
|
| EXPECT_CALL(sender_, Send(
|
| MatchMessage(static_cast<uint32>(P2PMsg_OnSendComplete::ID))))
|
| .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
|
| -
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet;
|
| CreateRandomPacket(&packet);
|
| - socket_host_->Send(dest1_, packet, options, 0);
|
| + socket_host_->Send(dest1_, packet, net::DSCP_NO_CHANGE, 0);
|
|
|
| ASSERT_EQ(1U, sent_packets_.size());
|
| ASSERT_EQ(dest1_, sent_packets_[0].first);
|
| @@ -291,11 +287,9 @@
|
| EXPECT_CALL(sender_, Send(
|
| MatchMessage(static_cast<uint32>(P2PMsg_OnSendComplete::ID))))
|
| .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
|
| -
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet;
|
| CreateRandomPacket(&packet);
|
| - socket_host_->Send(dest1_, packet, options, 0);
|
| + socket_host_->Send(dest1_, packet, net::DSCP_NO_CHANGE, 0);
|
|
|
| ASSERT_EQ(1U, sent_packets_.size());
|
| ASSERT_EQ(dest1_, sent_packets_[0].first);
|
| @@ -313,13 +307,12 @@
|
| socket_->ReceivePacket(dest1_, request_packet);
|
|
|
| // Should fail when trying to send the same packet to |dest2_|.
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet;
|
| CreateRandomPacket(&packet);
|
| EXPECT_CALL(sender_, Send(
|
| MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID))))
|
| .WillOnce(DoAll(DeleteArg<0>(), Return(true)));
|
| - socket_host_->Send(dest2_, packet, options, 0);
|
| + socket_host_->Send(dest2_, packet, net::DSCP_NO_CHANGE, 0);
|
| }
|
|
|
| // Verify throttler not allowing unlimited sending of ICE messages to
|
| @@ -330,16 +323,15 @@
|
| .Times(2)
|
| .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));
|
|
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet1;
|
| CreateStunRequest(&packet1);
|
| throttler_.SetSendIceBandwidth(packet1.size() * 2);
|
| - socket_host_->Send(dest1_, packet1, options, 0);
|
| - socket_host_->Send(dest2_, packet1, options, 0);
|
| + socket_host_->Send(dest1_, packet1, net::DSCP_NO_CHANGE, 0);
|
| + socket_host_->Send(dest2_, packet1, net::DSCP_NO_CHANGE, 0);
|
|
|
| net::IPEndPoint dest3 = ParseAddress(kTestIpAddress1, 2222);
|
| // This packet must be dropped by the throttler.
|
| - socket_host_->Send(dest3, packet1, options, 0);
|
| + socket_host_->Send(dest3, packet1, net::DSCP_NO_CHANGE, 0);
|
| ASSERT_EQ(sent_packets_.size(), 2U);
|
| }
|
|
|
| @@ -359,26 +351,25 @@
|
| .Times(4)
|
| .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));
|
|
|
| - talk_base::PacketOptions options;
|
| std::vector<char> packet1;
|
| CreateStunRequest(&packet1);
|
| throttler_.SetSendIceBandwidth(packet1.size());
|
| // |dest1_| is known address, throttling will not be applied.
|
| - socket_host_->Send(dest1_, packet1, options, 0);
|
| + socket_host_->Send(dest1_, packet1, net::DSCP_NO_CHANGE, 0);
|
| // Trying to send the packet to dest1_ in the same window. It should go.
|
| - socket_host_->Send(dest1_, packet1, options, 0);
|
| + socket_host_->Send(dest1_, packet1, net::DSCP_NO_CHANGE, 0);
|
|
|
| // Throttler should allow this packet to go through.
|
| - socket_host_->Send(dest2_, packet1, options, 0);
|
| + socket_host_->Send(dest2_, packet1, net::DSCP_NO_CHANGE, 0);
|
|
|
| net::IPEndPoint dest3 = ParseAddress(kTestIpAddress1, 2223);
|
| // This packet will be dropped, as limit only for a single packet.
|
| - socket_host_->Send(dest3, packet1, options, 0);
|
| + socket_host_->Send(dest3, packet1, net::DSCP_NO_CHANGE, 0);
|
| net::IPEndPoint dest4 = ParseAddress(kTestIpAddress1, 2224);
|
| // This packet should also be dropped.
|
| - socket_host_->Send(dest4, packet1, options, 0);
|
| + socket_host_->Send(dest4, packet1, net::DSCP_NO_CHANGE, 0);
|
| // |dest1| is known, we can send as many packets to it.
|
| - socket_host_->Send(dest1_, packet1, options, 0);
|
| + socket_host_->Send(dest1_, packet1, net::DSCP_NO_CHANGE, 0);
|
| ASSERT_EQ(sent_packets_.size(), 4U);
|
| }
|
|
|
|
|