OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/net/cast_transport_defines.h" | 9 #include "media/cast/net/cast_transport_defines.h" |
10 #include "media/cast/net/pacing/paced_sender.h" | 10 #include "media/cast/net/pacing/paced_sender.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 class TestRtcpTransport : public PacedPacketSender { | 44 class TestRtcpTransport : public PacedPacketSender { |
45 public: | 45 public: |
46 TestRtcpTransport() : packet_count_(0) {} | 46 TestRtcpTransport() : packet_count_(0) {} |
47 | 47 |
48 virtual bool SendRtcpPacket(uint32 ssrc, | 48 virtual bool SendRtcpPacket(uint32 ssrc, |
49 PacketRef packet) OVERRIDE { | 49 PacketRef packet) OVERRIDE { |
50 EXPECT_EQ(expected_packet_.size(), packet->data.size()); | 50 EXPECT_EQ(expected_packet_.size(), packet->data.size()); |
51 EXPECT_EQ(0, memcmp(expected_packet_.data(), | 51 if (expected_packet_.size() != packet->data.size()) |
52 packet->data.data(), | 52 return false; |
| 53 EXPECT_EQ(0, memcmp(&expected_packet_[0], |
| 54 &packet->data[0], |
53 packet->data.size())); | 55 packet->data.size())); |
54 packet_count_++; | 56 packet_count_++; |
55 return true; | 57 return true; |
56 } | 58 } |
57 | 59 |
58 virtual bool SendPackets( | 60 virtual bool SendPackets( |
59 const SendPacketVector& packets) OVERRIDE { | 61 const SendPacketVector& packets) OVERRIDE { |
60 return false; | 62 return false; |
61 } | 63 } |
62 virtual bool ResendPackets( | 64 virtual bool ResendPackets( |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 rtcp_sender_->SendRtcpFromRtpSender( | 600 rtcp_sender_->SendRtcpFromRtpSender( |
599 kRtcpSr | kRtcpDlrr, | 601 kRtcpSr | kRtcpDlrr, |
600 sender_info, | 602 sender_info, |
601 dlrr_rb); | 603 dlrr_rb); |
602 | 604 |
603 EXPECT_EQ(1, test_transport_.packet_count()); | 605 EXPECT_EQ(1, test_transport_.packet_count()); |
604 } | 606 } |
605 | 607 |
606 } // namespace cast | 608 } // namespace cast |
607 } // namespace media | 609 } // namespace media |
OLD | NEW |