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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

Issue 2846243002: Wire up rtc_packet_ids to P2PSocketHostTcp, which is required for correct BWE in WebRTC. (Closed)
Patch Set: Created 3 years, 7 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 | « content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc ('k') | 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 MATCHER_P(MatchIncomingSocketMessage, address, "") { 117 MATCHER_P(MatchIncomingSocketMessage, address, "") {
118 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) 118 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID)
119 return false; 119 return false;
120 P2PMsg_OnIncomingTcpConnection::Param params; 120 P2PMsg_OnIncomingTcpConnection::Param params;
121 P2PMsg_OnIncomingTcpConnection::Read( 121 P2PMsg_OnIncomingTcpConnection::Read(
122 arg, &params); 122 arg, &params);
123 return std::get<1>(params) == address; 123 return std::get<1>(params) == address;
124 } 124 }
125 125
126 MATCHER_P2(MatchSendPacketMetrics, rtc_packet_id, test_start_time, "") {
127 if (arg->type() != P2PMsg_OnSendComplete::ID)
128 return false;
129
130 P2PMsg_OnSendComplete::Param params;
131 P2PMsg_OnSendComplete::Read(arg, &params);
132 return std::get<1>(params).rtc_packet_id == rtc_packet_id &&
133 std::get<1>(params).send_time >= test_start_time &&
134 std::get<1>(params).send_time <= base::TimeTicks::Now();
135 }
136
126 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 137 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698