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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc

Issue 2846243002: Wire up rtc_packet_ids to P2PSocketHostTcp, which is required for correct BWE in WebRTC. (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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc
index b018b2741ccfbf5c50227f3c0c2b92275b627b22..61b8edb0d1e64e847a41f2228ec6a2970299ffa8 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc
@@ -249,6 +249,35 @@ TEST_F(P2PSocketHostTcpTest, AsyncWrites) {
EXPECT_EQ(expected_data, sent_data_);
}
+TEST_F(P2PSocketHostTcpTest, PacketIdIsPropagated) {
+ base::MessageLoop message_loop;
+
+ socket_->set_async_write(true);
+
+ const int32_t kRtcPacketId = 1234;
+
+ base::TimeTicks now = base::TimeTicks::Now();
+
+ EXPECT_CALL(sender_, Send(MatchSendPacketMetrics(kRtcPacketId, now)))
+ .Times(1)
+ .WillRepeatedly(DoAll(DeleteArg<0>(), Return(true)));
+
+ rtc::PacketOptions options;
+ options.packet_id = kRtcPacketId;
+ std::vector<char> packet1;
+ CreateStunRequest(&packet1);
+
+ socket_host_->Send(dest_.ip_address, packet1, options, 0);
+
+ base::RunLoop().RunUntilIdle();
+
+ std::string expected_data;
+ expected_data.append(IntToSize(packet1.size()));
+ expected_data.append(packet1.begin(), packet1.end());
+
+ EXPECT_EQ(expected_data, sent_data_);
+}
+
TEST_F(P2PSocketHostTcpTest, SendDataWithPacketOptions) {
std::vector<char> request_packet;
CreateStunRequest(&request_packet);
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.cc ('k') | content/browser/renderer_host/p2p/socket_host_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698