Support for unpacked ARM packed relocations.
[chromium-blink-merge.git] / media / cast / rtcp / rtcp_receiver_unittest.cc
blob51026d1554b0104ffc0d81b148bdc806f2b4c297
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
3 // found in the LICENSE file.
5 #include "base/memory/scoped_ptr.h"
6 #include "base/test/simple_test_tick_clock.h"
7 #include "media/cast/cast_environment.h"
8 #include "media/cast/rtcp/mock_rtcp_receiver_feedback.h"
9 #include "media/cast/rtcp/mock_rtcp_sender_feedback.h"
10 #include "media/cast/rtcp/rtcp_receiver.h"
11 #include "media/cast/rtcp/rtcp_utility.h"
12 #include "media/cast/rtcp/test_rtcp_packet_builder.h"
13 #include "media/cast/test/fake_single_thread_task_runner.h"
14 #include "media/cast/transport/cast_transport_defines.h"
15 #include "testing/gmock/include/gmock/gmock.h"
17 namespace media {
18 namespace cast {
20 using testing::_;
22 static const uint32 kSenderSsrc = 0x10203;
23 static const uint32 kSourceSsrc = 0x40506;
24 static const uint32 kUnknownSsrc = 0xDEAD;
25 static const uint16 kTargetDelayMs = 100;
26 static const std::string kCName("test@10.1.1.1");
28 namespace {
29 class SenderFeedbackCastVerification : public RtcpSenderFeedback {
30 public:
31 SenderFeedbackCastVerification() : called_(false) {}
33 virtual void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback)
34 OVERRIDE {
35 EXPECT_EQ(cast_feedback.media_ssrc_, kSenderSsrc);
36 EXPECT_EQ(cast_feedback.ack_frame_id_, kAckFrameId);
38 MissingFramesAndPacketsMap::const_iterator frame_it =
39 cast_feedback.missing_frames_and_packets_.begin();
41 EXPECT_TRUE(frame_it != cast_feedback.missing_frames_and_packets_.end());
42 EXPECT_EQ(kLostFrameId, frame_it->first);
43 EXPECT_EQ(frame_it->second.size(), 1UL);
44 EXPECT_EQ(*frame_it->second.begin(), kRtcpCastAllPacketsLost);
45 ++frame_it;
46 EXPECT_TRUE(frame_it != cast_feedback.missing_frames_and_packets_.end());
47 EXPECT_EQ(kFrameIdWithLostPackets, frame_it->first);
48 EXPECT_EQ(3UL, frame_it->second.size());
49 PacketIdSet::const_iterator packet_it = frame_it->second.begin();
50 EXPECT_EQ(kLostPacketId1, *packet_it);
51 ++packet_it;
52 EXPECT_EQ(kLostPacketId2, *packet_it);
53 ++packet_it;
54 EXPECT_EQ(kLostPacketId3, *packet_it);
55 ++frame_it;
56 EXPECT_EQ(frame_it, cast_feedback.missing_frames_and_packets_.end());
57 called_ = true;
60 bool called() const { return called_; }
62 private:
63 bool called_;
65 DISALLOW_COPY_AND_ASSIGN(SenderFeedbackCastVerification);
68 class RtcpReceiverCastLogVerification : public RtcpReceiverFeedback {
69 public:
70 RtcpReceiverCastLogVerification()
71 : called_on_received_sender_log_(false),
72 called_on_received_receiver_log_(false) {}
74 virtual void OnReceivedSenderReport(
75 const transport::RtcpSenderInfo& remote_sender_info) OVERRIDE{};
77 virtual void OnReceiverReferenceTimeReport(
78 const RtcpReceiverReferenceTimeReport& remote_time_report) OVERRIDE{};
80 virtual void OnReceivedSendReportRequest() OVERRIDE{};
82 virtual void OnReceivedReceiverLog(const RtcpReceiverLogMessage& receiver_log)
83 OVERRIDE {
84 EXPECT_EQ(expected_receiver_log_.size(), receiver_log.size());
85 RtcpReceiverLogMessage::const_iterator expected_it =
86 expected_receiver_log_.begin();
87 RtcpReceiverLogMessage::const_iterator incoming_it = receiver_log.begin();
88 for (; incoming_it != receiver_log.end(); ++incoming_it) {
89 EXPECT_EQ(expected_it->rtp_timestamp_, incoming_it->rtp_timestamp_);
90 EXPECT_EQ(expected_it->event_log_messages_.size(),
91 incoming_it->event_log_messages_.size());
93 RtcpReceiverEventLogMessages::const_iterator event_incoming_it =
94 incoming_it->event_log_messages_.begin();
95 RtcpReceiverEventLogMessages::const_iterator event_expected_it =
96 expected_it->event_log_messages_.begin();
97 for (; event_incoming_it != incoming_it->event_log_messages_.end();
98 ++event_incoming_it, ++event_expected_it) {
99 EXPECT_EQ(event_expected_it->type, event_incoming_it->type);
100 EXPECT_EQ(event_expected_it->event_timestamp,
101 event_incoming_it->event_timestamp);
102 if (event_expected_it->type == PACKET_RECEIVED) {
103 EXPECT_EQ(event_expected_it->packet_id, event_incoming_it->packet_id);
104 } else {
105 EXPECT_EQ(event_expected_it->delay_delta,
106 event_incoming_it->delay_delta);
109 expected_receiver_log_.pop_front();
110 expected_it = expected_receiver_log_.begin();
112 called_on_received_receiver_log_ = true;
115 bool OnReceivedReceiverLogCalled() {
116 return called_on_received_receiver_log_ && expected_receiver_log_.empty();
119 void SetExpectedReceiverLog(const RtcpReceiverLogMessage& receiver_log) {
120 expected_receiver_log_ = receiver_log;
123 private:
124 RtcpReceiverLogMessage expected_receiver_log_;
125 bool called_on_received_sender_log_;
126 bool called_on_received_receiver_log_;
128 DISALLOW_COPY_AND_ASSIGN(RtcpReceiverCastLogVerification);
131 } // namespace
133 class RtcpReceiverTest : public ::testing::Test {
134 protected:
135 RtcpReceiverTest()
136 : testing_clock_(new base::SimpleTestTickClock()),
137 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)),
138 cast_environment_(new CastEnvironment(
139 scoped_ptr<base::TickClock>(testing_clock_).Pass(),
140 task_runner_,
141 task_runner_,
142 task_runner_)),
143 rtcp_receiver_(new RtcpReceiver(cast_environment_,
144 &mock_sender_feedback_,
145 &mock_receiver_feedback_,
146 &mock_rtt_feedback_,
147 kSourceSsrc)) {
148 EXPECT_CALL(mock_receiver_feedback_, OnReceivedSenderReport(_)).Times(0);
149 EXPECT_CALL(mock_receiver_feedback_, OnReceiverReferenceTimeReport(_))
150 .Times(0);
151 EXPECT_CALL(mock_receiver_feedback_, OnReceivedSendReportRequest())
152 .Times(0);
153 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(0);
154 EXPECT_CALL(mock_rtt_feedback_, OnReceivedDelaySinceLastReport(_, _, _))
155 .Times(0);
157 expected_sender_info_.ntp_seconds = kNtpHigh;
158 expected_sender_info_.ntp_fraction = kNtpLow;
159 expected_sender_info_.rtp_timestamp = kRtpTimestamp;
160 expected_sender_info_.send_packet_count = kSendPacketCount;
161 expected_sender_info_.send_octet_count = kSendOctetCount;
163 expected_report_block_.remote_ssrc = kSenderSsrc;
164 expected_report_block_.media_ssrc = kSourceSsrc;
165 expected_report_block_.fraction_lost = kLoss >> 24;
166 expected_report_block_.cumulative_lost = kLoss & 0xffffff;
167 expected_report_block_.extended_high_sequence_number = kExtendedMax;
168 expected_report_block_.jitter = kTestJitter;
169 expected_report_block_.last_sr = kLastSr;
170 expected_report_block_.delay_since_last_sr = kDelayLastSr;
171 expected_receiver_reference_report_.remote_ssrc = kSenderSsrc;
172 expected_receiver_reference_report_.ntp_seconds = kNtpHigh;
173 expected_receiver_reference_report_.ntp_fraction = kNtpLow;
176 virtual ~RtcpReceiverTest() {}
178 // Injects an RTCP packet into the receiver.
179 void InjectRtcpPacket(const uint8* packet, uint16 length) {
180 RtcpParser rtcp_parser(packet, length);
181 rtcp_receiver_->IncomingRtcpPacket(&rtcp_parser);
184 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment.
185 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
186 scoped_refptr<CastEnvironment> cast_environment_;
187 MockRtcpReceiverFeedback mock_receiver_feedback_;
188 MockRtcpRttFeedback mock_rtt_feedback_;
189 MockRtcpSenderFeedback mock_sender_feedback_;
190 scoped_ptr<RtcpReceiver> rtcp_receiver_;
191 transport::RtcpSenderInfo expected_sender_info_;
192 transport::RtcpReportBlock expected_report_block_;
193 RtcpReceiverReferenceTimeReport expected_receiver_reference_report_;
195 DISALLOW_COPY_AND_ASSIGN(RtcpReceiverTest);
198 TEST_F(RtcpReceiverTest, BrokenPacketIsIgnored) {
199 const uint8 bad_packet[] = {0, 0, 0, 0};
200 InjectRtcpPacket(bad_packet, sizeof(bad_packet));
203 TEST_F(RtcpReceiverTest, InjectSenderReportPacket) {
204 TestRtcpPacketBuilder p;
205 p.AddSr(kSenderSsrc, 0);
207 // Expected to be ignored since the sender ssrc does not match our
208 // remote ssrc.
209 InjectRtcpPacket(p.Data(), p.Length());
211 EXPECT_CALL(mock_receiver_feedback_,
212 OnReceivedSenderReport(expected_sender_info_)).Times(1);
213 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
215 // Expected to be pass through since the sender ssrc match our remote ssrc.
216 InjectRtcpPacket(p.Data(), p.Length());
219 TEST_F(RtcpReceiverTest, InjectReceiveReportPacket) {
220 TestRtcpPacketBuilder p1;
221 p1.AddRr(kSenderSsrc, 1);
222 p1.AddRb(kUnknownSsrc);
224 // Expected to be ignored since the source ssrc does not match our
225 // local ssrc.
226 InjectRtcpPacket(p1.Data(), p1.Length());
228 EXPECT_CALL(mock_rtt_feedback_,
229 OnReceivedDelaySinceLastReport(
230 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
232 TestRtcpPacketBuilder p2;
233 p2.AddRr(kSenderSsrc, 1);
234 p2.AddRb(kSourceSsrc);
236 // Expected to be pass through since the sender ssrc match our local ssrc.
237 InjectRtcpPacket(p2.Data(), p2.Length());
240 TEST_F(RtcpReceiverTest, InjectSenderReportWithReportBlockPacket) {
241 TestRtcpPacketBuilder p1;
242 p1.AddSr(kSenderSsrc, 1);
243 p1.AddRb(kUnknownSsrc);
245 // Sender report expected to be ignored since the sender ssrc does not match
246 // our remote ssrc.
247 // Report block expected to be ignored since the source ssrc does not match
248 // our local ssrc.
249 InjectRtcpPacket(p1.Data(), p1.Length());
251 EXPECT_CALL(mock_receiver_feedback_,
252 OnReceivedSenderReport(expected_sender_info_)).Times(1);
253 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
255 // Sender report expected to be pass through since the sender ssrc match our
256 // remote ssrc.
257 // Report block expected to be ignored since the source ssrc does not match
258 // our local ssrc.
259 InjectRtcpPacket(p1.Data(), p1.Length());
261 EXPECT_CALL(mock_receiver_feedback_, OnReceivedSenderReport(_)).Times(0);
262 EXPECT_CALL(mock_rtt_feedback_,
263 OnReceivedDelaySinceLastReport(
264 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
266 rtcp_receiver_->SetRemoteSSRC(0);
268 TestRtcpPacketBuilder p2;
269 p2.AddSr(kSenderSsrc, 1);
270 p2.AddRb(kSourceSsrc);
272 // Sender report expected to be ignored since the sender ssrc does not match
273 // our remote ssrc.
274 // Receiver report expected to be pass through since the sender ssrc match
275 // our local ssrc.
276 InjectRtcpPacket(p2.Data(), p2.Length());
278 EXPECT_CALL(mock_receiver_feedback_,
279 OnReceivedSenderReport(expected_sender_info_)).Times(1);
280 EXPECT_CALL(mock_rtt_feedback_,
281 OnReceivedDelaySinceLastReport(
282 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
284 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
286 // Sender report expected to be pass through since the sender ssrc match our
287 // remote ssrc.
288 // Receiver report expected to be pass through since the sender ssrc match
289 // our local ssrc.
290 InjectRtcpPacket(p2.Data(), p2.Length());
293 TEST_F(RtcpReceiverTest, InjectSenderReportPacketWithDlrr) {
294 TestRtcpPacketBuilder p;
295 p.AddSr(kSenderSsrc, 0);
296 p.AddXrHeader(kSenderSsrc);
297 p.AddXrUnknownBlock();
298 p.AddXrExtendedDlrrBlock(kSenderSsrc);
299 p.AddXrUnknownBlock();
300 p.AddSdesCname(kSenderSsrc, kCName);
302 // Expected to be ignored since the source ssrc does not match our
303 // local ssrc.
304 InjectRtcpPacket(p.Data(), p.Length());
306 EXPECT_CALL(mock_receiver_feedback_,
307 OnReceivedSenderReport(expected_sender_info_)).Times(1);
308 EXPECT_CALL(mock_rtt_feedback_,
309 OnReceivedDelaySinceLastReport(
310 kSenderSsrc, kLastSr, kDelayLastSr)).Times(1);
312 // Enable receiving sender report.
313 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
315 // Expected to be pass through since the sender ssrc match our local ssrc.
316 InjectRtcpPacket(p.Data(), p.Length());
319 TEST_F(RtcpReceiverTest, InjectReceiverReportPacketWithRrtr) {
320 TestRtcpPacketBuilder p1;
321 p1.AddRr(kSenderSsrc, 1);
322 p1.AddRb(kUnknownSsrc);
323 p1.AddXrHeader(kSenderSsrc);
324 p1.AddXrRrtrBlock();
326 // Expected to be ignored since the source ssrc does not match our
327 // local ssrc.
328 InjectRtcpPacket(p1.Data(), p1.Length());
330 EXPECT_CALL(mock_rtt_feedback_,
331 OnReceivedDelaySinceLastReport(
332 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
333 EXPECT_CALL(mock_receiver_feedback_,
334 OnReceiverReferenceTimeReport(
335 expected_receiver_reference_report_)).Times(1);
337 // Enable receiving reference time report.
338 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
340 TestRtcpPacketBuilder p2;
341 p2.AddRr(kSenderSsrc, 1);
342 p2.AddRb(kSourceSsrc);
343 p2.AddXrHeader(kSenderSsrc);
344 p2.AddXrRrtrBlock();
346 // Expected to be pass through since the sender ssrc match our local ssrc.
347 InjectRtcpPacket(p2.Data(), p2.Length());
350 TEST_F(RtcpReceiverTest, InjectReceiverReportPacketWithIntraFrameRequest) {
351 TestRtcpPacketBuilder p1;
352 p1.AddRr(kSenderSsrc, 1);
353 p1.AddRb(kUnknownSsrc);
354 p1.AddPli(kSenderSsrc, kUnknownSsrc);
356 // Expected to be ignored since the source ssrc does not match our
357 // local ssrc.
358 InjectRtcpPacket(p1.Data(), p1.Length());
360 EXPECT_CALL(mock_rtt_feedback_,
361 OnReceivedDelaySinceLastReport(
362 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
364 TestRtcpPacketBuilder p2;
365 p2.AddRr(kSenderSsrc, 1);
366 p2.AddRb(kSourceSsrc);
367 p2.AddPli(kSenderSsrc, kSourceSsrc);
369 // Expected to be pass through since the sender ssrc match our local ssrc.
370 InjectRtcpPacket(p2.Data(), p2.Length());
373 TEST_F(RtcpReceiverTest, InjectReceiverReportPacketWithCastFeedback) {
374 TestRtcpPacketBuilder p1;
375 p1.AddRr(kSenderSsrc, 1);
376 p1.AddRb(kUnknownSsrc);
377 p1.AddCast(kSenderSsrc, kUnknownSsrc, kTargetDelayMs);
379 // Expected to be ignored since the source ssrc does not match our
380 // local ssrc.
381 InjectRtcpPacket(p1.Data(), p1.Length());
383 EXPECT_CALL(mock_rtt_feedback_,
384 OnReceivedDelaySinceLastReport(
385 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
386 EXPECT_CALL(mock_sender_feedback_, OnReceivedCastFeedback(_)).Times(1);
388 // Enable receiving the cast feedback.
389 rtcp_receiver_->SetRemoteSSRC(kSenderSsrc);
391 TestRtcpPacketBuilder p2;
392 p2.AddRr(kSenderSsrc, 1);
393 p2.AddRb(kSourceSsrc);
394 p2.AddCast(kSenderSsrc, kSourceSsrc, kTargetDelayMs);
396 // Expected to be pass through since the sender ssrc match our local ssrc.
397 InjectRtcpPacket(p2.Data(), p2.Length());
400 TEST_F(RtcpReceiverTest, InjectReceiverReportPacketWithCastVerification) {
401 SenderFeedbackCastVerification sender_feedback_cast_verification;
402 RtcpReceiver rtcp_receiver(cast_environment_,
403 &sender_feedback_cast_verification,
404 &mock_receiver_feedback_,
405 &mock_rtt_feedback_,
406 kSourceSsrc);
408 EXPECT_CALL(mock_rtt_feedback_,
409 OnReceivedDelaySinceLastReport(
410 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
412 // Enable receiving the cast feedback.
413 rtcp_receiver.SetRemoteSSRC(kSenderSsrc);
415 TestRtcpPacketBuilder p;
416 p.AddRr(kSenderSsrc, 1);
417 p.AddRb(kSourceSsrc);
418 p.AddCast(kSenderSsrc, kSourceSsrc, kTargetDelayMs);
420 // Expected to be pass through since the sender ssrc match our local ssrc.
421 RtcpParser rtcp_parser(p.Data(), p.Length());
422 rtcp_receiver.IncomingRtcpPacket(&rtcp_parser);
424 EXPECT_TRUE(sender_feedback_cast_verification.called());
427 TEST_F(RtcpReceiverTest, InjectReceiverReportWithReceiverLogVerificationBase) {
428 static const uint32 kTimeBaseMs = 12345678;
429 static const uint32 kTimeDelayMs = 10;
430 static const uint32 kDelayDeltaMs = 123;
431 base::SimpleTestTickClock testing_clock;
432 testing_clock.Advance(base::TimeDelta::FromMilliseconds(kTimeBaseMs));
434 RtcpReceiverCastLogVerification cast_log_verification;
435 RtcpReceiver rtcp_receiver(cast_environment_,
436 &mock_sender_feedback_,
437 &cast_log_verification,
438 &mock_rtt_feedback_,
439 kSourceSsrc);
440 rtcp_receiver.SetRemoteSSRC(kSenderSsrc);
441 rtcp_receiver.SetCastReceiverEventHistorySize(100);
443 RtcpReceiverLogMessage receiver_log;
444 RtcpReceiverFrameLogMessage frame_log(kRtpTimestamp);
445 RtcpReceiverEventLogMessage event_log;
447 event_log.type = FRAME_ACK_SENT;
448 event_log.event_timestamp = testing_clock.NowTicks();
449 event_log.delay_delta = base::TimeDelta::FromMilliseconds(kDelayDeltaMs);
450 frame_log.event_log_messages_.push_back(event_log);
452 testing_clock.Advance(base::TimeDelta::FromMilliseconds(kTimeDelayMs));
453 event_log.type = PACKET_RECEIVED;
454 event_log.event_timestamp = testing_clock.NowTicks();
455 event_log.packet_id = kLostPacketId1;
456 frame_log.event_log_messages_.push_back(event_log);
458 event_log.type = PACKET_RECEIVED;
459 event_log.event_timestamp = testing_clock.NowTicks();
460 event_log.packet_id = kLostPacketId2;
461 frame_log.event_log_messages_.push_back(event_log);
463 receiver_log.push_back(frame_log);
465 cast_log_verification.SetExpectedReceiverLog(receiver_log);
467 TestRtcpPacketBuilder p;
468 p.AddRr(kSenderSsrc, 1);
469 p.AddRb(kSourceSsrc);
470 p.AddReceiverLog(kSenderSsrc);
471 p.AddReceiverFrameLog(kRtpTimestamp, 3, kTimeBaseMs);
472 p.AddReceiverEventLog(kDelayDeltaMs, FRAME_ACK_SENT, 0);
473 p.AddReceiverEventLog(kLostPacketId1, PACKET_RECEIVED, kTimeDelayMs);
474 p.AddReceiverEventLog(kLostPacketId2, PACKET_RECEIVED, kTimeDelayMs);
476 // Adds duplicated receiver event.
477 p.AddReceiverFrameLog(kRtpTimestamp, 3, kTimeBaseMs);
478 p.AddReceiverEventLog(kDelayDeltaMs, FRAME_ACK_SENT, 0);
479 p.AddReceiverEventLog(kLostPacketId1, PACKET_RECEIVED, kTimeDelayMs);
480 p.AddReceiverEventLog(kLostPacketId2, PACKET_RECEIVED, kTimeDelayMs);
482 EXPECT_CALL(mock_rtt_feedback_,
483 OnReceivedDelaySinceLastReport(
484 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
486 RtcpParser rtcp_parser(p.Data(), p.Length());
487 rtcp_receiver.IncomingRtcpPacket(&rtcp_parser);
489 EXPECT_TRUE(cast_log_verification.OnReceivedReceiverLogCalled());
492 TEST_F(RtcpReceiverTest, InjectReceiverReportWithReceiverLogVerificationMulti) {
493 static const uint32 kTimeBaseMs = 12345678;
494 static const uint32 kTimeDelayMs = 10;
495 static const uint32 kDelayDeltaMs = 123;
496 base::SimpleTestTickClock testing_clock;
497 testing_clock.Advance(base::TimeDelta::FromMilliseconds(kTimeBaseMs));
499 RtcpReceiverCastLogVerification cast_log_verification;
500 RtcpReceiver rtcp_receiver(cast_environment_,
501 &mock_sender_feedback_,
502 &cast_log_verification,
503 &mock_rtt_feedback_,
504 kSourceSsrc);
505 rtcp_receiver.SetRemoteSSRC(kSenderSsrc);
507 RtcpReceiverLogMessage receiver_log;
509 for (int j = 0; j < 100; ++j) {
510 RtcpReceiverFrameLogMessage frame_log(kRtpTimestamp);
511 RtcpReceiverEventLogMessage event_log;
512 event_log.type = FRAME_ACK_SENT;
513 event_log.event_timestamp = testing_clock.NowTicks();
514 event_log.delay_delta = base::TimeDelta::FromMilliseconds(kDelayDeltaMs);
515 frame_log.event_log_messages_.push_back(event_log);
516 receiver_log.push_back(frame_log);
517 testing_clock.Advance(base::TimeDelta::FromMilliseconds(kTimeDelayMs));
520 cast_log_verification.SetExpectedReceiverLog(receiver_log);
522 TestRtcpPacketBuilder p;
523 p.AddRr(kSenderSsrc, 1);
524 p.AddRb(kSourceSsrc);
525 p.AddReceiverLog(kSenderSsrc);
526 for (int i = 0; i < 100; ++i) {
527 p.AddReceiverFrameLog(kRtpTimestamp, 1, kTimeBaseMs + i * kTimeDelayMs);
528 p.AddReceiverEventLog(kDelayDeltaMs, FRAME_ACK_SENT, 0);
531 EXPECT_CALL(mock_rtt_feedback_,
532 OnReceivedDelaySinceLastReport(
533 kSourceSsrc, kLastSr, kDelayLastSr)).Times(1);
535 RtcpParser rtcp_parser(p.Data(), p.Length());
536 rtcp_receiver.IncomingRtcpPacket(&rtcp_parser);
538 EXPECT_TRUE(cast_log_verification.OnReceivedReceiverLogCalled());
541 } // namespace cast
542 } // namespace media