Chromium Code Reviews| Index: content/browser/renderer_host/p2p/socket_host_test_utils.h |
| diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h |
| index 8d2d2440fc5cb4017318d77847d5689dea5c3b97..3f9100c242da64d987a0605db4c77a6ea7d6b70f 100644 |
| --- a/content/browser/renderer_host/p2p/socket_host_test_utils.h |
| +++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h |
| @@ -123,4 +123,15 @@ MATCHER_P(MatchIncomingSocketMessage, address, "") { |
| return std::get<1>(params) == address; |
| } |
| +MATCHER_P(MatchSendPacketMetrics, rtc_packet_id, "") { |
| + if (arg->type() != P2PMsg_OnSendComplete::ID) |
| + return false; |
| + |
| + P2PMsg_OnSendComplete::Param params; |
| + P2PMsg_OnSendComplete::Read(arg, ¶ms); |
| + return std::get<1>(params).rtc_packet_id == rtc_packet_id && |
| + (base::TimeTicks::Now() - std::get<1>(params).send_time) |
| + .InMilliseconds() < 100; |
|
Taylor_Brandstetter
2017/04/25 21:34:19
nit: Could you make the 100 milliseconds an argume
Sergey Ulanov
2017/04/26 00:11:52
+1. This test may be flaky. Also it currently does
Stefan
2017/04/26 09:02:39
Done.
|
| +} |
| + |
| #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |