OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/test/simple_test_tick_clock.h" | 5 #include "base/test/simple_test_tick_clock.h" |
6 #include "media/cast/cast_defines.h" | 6 #include "media/cast/cast_defines.h" |
7 #include "media/cast/pacing/paced_sender.h" | 7 #include "media/cast/pacing/paced_sender.h" |
8 #include "media/cast/rtcp/mock_rtcp_receiver_feedback.h" | 8 #include "media/cast/rtcp/mock_rtcp_receiver_feedback.h" |
9 #include "media/cast/rtcp/mock_rtcp_sender_feedback.h" | 9 #include "media/cast/rtcp/mock_rtcp_sender_feedback.h" |
10 #include "media/cast/rtcp/rtcp.h" | 10 #include "media/cast/rtcp/rtcp.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 }; | 89 }; |
90 | 90 |
91 class RtcpTest : public ::testing::Test { | 91 class RtcpTest : public ::testing::Test { |
92 protected: | 92 protected: |
93 RtcpTest() | 93 RtcpTest() |
94 : transport_(&testing_clock_) { | 94 : transport_(&testing_clock_) { |
95 testing_clock_.Advance( | 95 testing_clock_.Advance( |
96 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 96 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
97 } | 97 } |
98 | 98 |
99 virtual ~RtcpTest() {} | 99 ~RtcpTest() {} |
100 | 100 |
101 virtual void SetUp() { | 101 void SetUp() { |
102 EXPECT_CALL(mock_sender_feedback_, OnReceivedReportBlock(_)).Times(0); | 102 EXPECT_CALL(mock_sender_feedback_, OnReceivedReportBlock(_)).Times(0); |
103 EXPECT_CALL(mock_sender_feedback_, OnReceivedIntraFrameRequest()).Times(0); | 103 EXPECT_CALL(mock_sender_feedback_, OnReceivedIntraFrameRequest()).Times(0); |
104 EXPECT_CALL(mock_sender_feedback_, OnReceivedRpsi(_, _)).Times(0); | 104 EXPECT_CALL(mock_sender_feedback_, OnReceivedRpsi(_, _)).Times(0); |
105 EXPECT_CALL(mock_sender_feedback_, OnReceivedRemb(_)).Times(0); | 105 EXPECT_CALL(mock_sender_feedback_, OnReceivedRemb(_)).Times(0); |
106 EXPECT_CALL(mock_sender_feedback_, OnReceivedNackRequest(_)).Times(0); | 106 EXPECT_CALL(mock_sender_feedback_, OnReceivedNackRequest(_)).Times(0); |
107 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(0); | 107 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(0); |
108 } | 108 } |
109 | 109 |
110 base::SimpleTestTickClock testing_clock_; | 110 base::SimpleTestTickClock testing_clock_; |
111 LocalRtcpTransport transport_; | 111 LocalRtcpTransport transport_; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 kRtcpReducedSize, | 196 kRtcpReducedSize, |
197 base::TimeDelta::FromMilliseconds(kRtcpIntervalMs), | 197 base::TimeDelta::FromMilliseconds(kRtcpIntervalMs), |
198 false, | 198 false, |
199 kSenderSsrc, | 199 kSenderSsrc, |
200 kCName); | 200 kCName); |
201 rtcp.set_clock(&testing_clock_); | 201 rtcp.set_clock(&testing_clock_); |
202 transport_.SetRtcpReceiver(&rtcp); | 202 transport_.SetRtcpReceiver(&rtcp); |
203 rtcp.SetRemoteSSRC(kSenderSsrc); | 203 rtcp.SetRemoteSSRC(kSenderSsrc); |
204 RtcpCastMessage cast_message(kSenderSsrc); | 204 RtcpCastMessage cast_message(kSenderSsrc); |
205 cast_message.ack_frame_id_ = kAckFrameId; | 205 cast_message.ack_frame_id_ = kAckFrameId; |
206 std::set<uint16> missing_packets; | 206 std::set<uint16_t> missing_packets; |
207 cast_message.missing_frames_and_packets_[ | 207 cast_message.missing_frames_and_packets_[ |
208 kLostFrameId] = missing_packets; | 208 kLostFrameId] = missing_packets; |
209 | 209 |
210 missing_packets.insert(kLostPacketId1); | 210 missing_packets.insert(kLostPacketId1); |
211 missing_packets.insert(kLostPacketId2); | 211 missing_packets.insert(kLostPacketId2); |
212 missing_packets.insert(kLostPacketId3); | 212 missing_packets.insert(kLostPacketId3); |
213 cast_message.missing_frames_and_packets_[ | 213 cast_message.missing_frames_and_packets_[ |
214 kFrameIdWithLostPackets] = missing_packets; | 214 kFrameIdWithLostPackets] = missing_packets; |
215 rtcp.SendRtcpCast(cast_message); | 215 rtcp.SendRtcpCast(cast_message); |
216 } | 216 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 rtcp_peer.OnReceivedLipSyncInfo(rtp_timestamp, ntp_seconds, ntp_fractions); | 401 rtcp_peer.OnReceivedLipSyncInfo(rtp_timestamp, ntp_seconds, ntp_fractions); |
402 rtp_timestamp = 64000; | 402 rtp_timestamp = 64000; |
403 EXPECT_TRUE(rtcp_peer.RtpTimestampInSenderTime(frequency, rtp_timestamp, | 403 EXPECT_TRUE(rtcp_peer.RtpTimestampInSenderTime(frequency, rtp_timestamp, |
404 &rtp_timestamp_in_ticks)); | 404 &rtp_timestamp_in_ticks)); |
405 EXPECT_EQ(input_time + base::TimeDelta::FromMilliseconds(4000), | 405 EXPECT_EQ(input_time + base::TimeDelta::FromMilliseconds(4000), |
406 rtp_timestamp_in_ticks); | 406 rtp_timestamp_in_ticks); |
407 } | 407 } |
408 | 408 |
409 } // namespace cast | 409 } // namespace cast |
410 } // namespace media | 410 } // namespace media |
OLD | NEW |