| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/test/simple_test_tick_clock.h" | 6 #include "base/test/simple_test_tick_clock.h" |
| 7 #include "media/cast/cast_defines.h" | 7 #include "media/cast/cast_defines.h" |
| 8 #include "media/cast/cast_environment.h" | 8 #include "media/cast/cast_environment.h" |
| 9 #include "media/cast/rtcp/receiver_rtcp_event_subscriber.h" | 9 #include "media/cast/rtcp/receiver_rtcp_event_subscriber.h" |
| 10 #include "media/cast/rtcp/rtcp_sender.h" | 10 #include "media/cast/rtcp/rtcp_sender.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 report_block.delay_since_last_sr = kDelayLastSr; | 37 report_block.delay_since_last_sr = kDelayLastSr; |
| 38 return report_block; | 38 return report_block; |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 class TestRtcpTransport : public transport::PacedPacketSender { | 43 class TestRtcpTransport : public transport::PacedPacketSender { |
| 44 public: | 44 public: |
| 45 TestRtcpTransport() : packet_count_(0) {} | 45 TestRtcpTransport() : packet_count_(0) {} |
| 46 | 46 |
| 47 virtual bool SendRtcpPacket(transport::PacketRef packet) OVERRIDE { | 47 virtual bool SendRtcpPacket(uint32 ssrc, |
| 48 transport::PacketRef packet) OVERRIDE { |
| 48 EXPECT_EQ(expected_packet_.size(), packet->data.size()); | 49 EXPECT_EQ(expected_packet_.size(), packet->data.size()); |
| 49 EXPECT_EQ(0, memcmp(expected_packet_.data(), | 50 EXPECT_EQ(0, memcmp(expected_packet_.data(), |
| 50 packet->data.data(), | 51 packet->data.data(), |
| 51 packet->data.size())); | 52 packet->data.size())); |
| 52 packet_count_++; | 53 packet_count_++; |
| 53 return true; | 54 return true; |
| 54 } | 55 } |
| 55 | 56 |
| 56 virtual bool SendPackets(const PacketList& packets) OVERRIDE { return false; } | 57 virtual bool SendPackets( |
| 57 | 58 const transport::SendPacketVector& packets) OVERRIDE { |
| 58 virtual bool ResendPackets(const PacketList& packets) OVERRIDE { | 59 return false; |
| 60 } |
| 61 virtual bool ResendPackets( |
| 62 const transport::SendPacketVector& packets) OVERRIDE { |
| 59 return false; | 63 return false; |
| 60 } | 64 } |
| 61 | 65 |
| 62 void SetExpectedRtcpPacket(scoped_ptr<Packet> packet) { | 66 void SetExpectedRtcpPacket(scoped_ptr<Packet> packet) { |
| 63 expected_packet_.swap(*packet); | 67 expected_packet_.swap(*packet); |
| 64 } | 68 } |
| 65 | 69 |
| 66 int packet_count() const { return packet_count_; } | 70 int packet_count() const { return packet_count_; } |
| 67 | 71 |
| 68 private: | 72 private: |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 testing_clock.Advance( | 539 testing_clock.Advance( |
| 536 base::TimeDelta::FromMilliseconds(kTimeBetweenEventsMs)); | 540 base::TimeDelta::FromMilliseconds(kTimeBetweenEventsMs)); |
| 537 time_base_ms += kTimeBetweenEventsMs; | 541 time_base_ms += kTimeBetweenEventsMs; |
| 538 } | 542 } |
| 539 | 543 |
| 540 EXPECT_EQ(static_cast<int>(packet_count), test_transport_.packet_count()); | 544 EXPECT_EQ(static_cast<int>(packet_count), test_transport_.packet_count()); |
| 541 } | 545 } |
| 542 | 546 |
| 543 } // namespace cast | 547 } // namespace cast |
| 544 } // namespace media | 548 } // namespace media |
| OLD | NEW |