Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: media/cast/rtcp/rtcp_sender_unittest.cc

Issue 109413004: Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/cast/rtcp/rtcp_sender.cc ('k') | media/cast/rtcp/rtcp_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_sender.h" 9 #include "media/cast/rtcp/rtcp_sender.h"
10 #include "media/cast/rtcp/rtcp_utility.h" 10 #include "media/cast/rtcp/rtcp_utility.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 void SetExpectedRtcpPacket(const uint8* rtcp_buffer, size_t length) { 48 void SetExpectedRtcpPacket(const uint8* rtcp_buffer, size_t length) {
49 expected_packet_length_ = length; 49 expected_packet_length_ = length;
50 memcpy(expected_packet_, rtcp_buffer, length); 50 memcpy(expected_packet_, rtcp_buffer, length);
51 } 51 }
52 52
53 int packet_count() const { return packet_count_; } 53 int packet_count() const { return packet_count_; }
54 54
55 private: 55 private:
56 uint8 expected_packet_[kIpPacketSize]; 56 uint8 expected_packet_[kMaxIpPacketSize];
57 size_t expected_packet_length_; 57 size_t expected_packet_length_;
58 int packet_count_; 58 int packet_count_;
59 }; 59 };
60 60
61 class RtcpSenderTest : public ::testing::Test { 61 class RtcpSenderTest : public ::testing::Test {
62 protected: 62 protected:
63 RtcpSenderTest() 63 RtcpSenderTest()
64 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), 64 : task_runner_(new test::FakeTaskRunner(&testing_clock_)),
65 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, 65 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_,
66 task_runner_, task_runner_, task_runner_, task_runner_, 66 task_runner_, task_runner_, task_runner_, task_runner_,
67 GetDefaultCastLoggingConfig())), 67 task_runner_, GetDefaultCastLoggingConfig())),
68 rtcp_sender_(new RtcpSender(cast_environment_, 68 rtcp_sender_(new RtcpSender(cast_environment_,
69 &test_transport_, 69 &test_transport_,
70 kSendingSsrc, 70 kSendingSsrc,
71 kCName)) { 71 kCName)) {
72 } 72 }
73 73
74 base::SimpleTestTickClock testing_clock_; 74 base::SimpleTestTickClock testing_clock_;
75 TestRtcpTransport test_transport_; 75 TestRtcpTransport test_transport_;
76 scoped_refptr<test::FakeTaskRunner> task_runner_; 76 scoped_refptr<test::FakeTaskRunner> task_runner_;
77 scoped_refptr<CastEnvironment> cast_environment_; 77 scoped_refptr<CastEnvironment> cast_environment_;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 NULL, 452 NULL,
453 NULL, 453 NULL,
454 &receiver_log); 454 &receiver_log);
455 455
456 EXPECT_EQ(1, test_transport_.packet_count()); 456 EXPECT_EQ(1, test_transport_.packet_count());
457 EXPECT_EQ(81u, receiver_log.size()); 457 EXPECT_EQ(81u, receiver_log.size());
458 } 458 }
459 459
460 } // namespace cast 460 } // namespace cast
461 } // namespace media 461 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtcp/rtcp_sender.cc ('k') | media/cast/rtcp/rtcp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698