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/rtcp_utility.h" | 9 #include "media/cast/rtcp/rtcp_utility.h" |
10 #include "media/cast/rtcp/test_rtcp_packet_builder.h" | 10 #include "media/cast/rtcp/test_rtcp_packet_builder.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 void SetExpectedRtcpPacket(const uint8* rtcp_buffer, size_t length) { | 46 void SetExpectedRtcpPacket(const uint8* rtcp_buffer, size_t length) { |
47 expected_packet_length_ = length; | 47 expected_packet_length_ = length; |
48 memcpy(expected_packet_, rtcp_buffer, length); | 48 memcpy(expected_packet_, rtcp_buffer, length); |
49 } | 49 } |
50 | 50 |
51 int packet_count() const { return packet_count_; } | 51 int packet_count() const { return packet_count_; } |
52 | 52 |
53 private: | 53 private: |
54 uint8 expected_packet_[kMaxIpPacketSize]; | 54 uint8 expected_packet_[kIpPacketSize]; |
55 size_t expected_packet_length_; | 55 size_t expected_packet_length_; |
56 int packet_count_; | 56 int packet_count_; |
57 }; | 57 }; |
58 | 58 |
59 class RtcpBuilderTest : public ::testing::Test { | 59 class RtcpBuilderTest : public ::testing::Test { |
60 protected: | 60 protected: |
61 RtcpBuilderTest() | 61 RtcpBuilderTest() |
62 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), | 62 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), |
63 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, | 63 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, |
64 task_runner_, task_runner_, task_runner_, task_runner_, | 64 task_runner_, task_runner_, task_runner_, task_runner_, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 &sender_info, | 199 &sender_info, |
200 NULL, | 200 NULL, |
201 &sender_log); | 201 &sender_log); |
202 | 202 |
203 EXPECT_EQ(1, test_transport_.packet_count()); | 203 EXPECT_EQ(1, test_transport_.packet_count()); |
204 EXPECT_EQ(41u, sender_log.size()); | 204 EXPECT_EQ(41u, sender_log.size()); |
205 } | 205 } |
206 | 206 |
207 } // namespace cast | 207 } // namespace cast |
208 } // namespace media | 208 } // namespace media |
OLD | NEW |