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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
8 #include "media/cast/audio_sender/audio_sender.h" | 8 #include "media/cast/audio_sender/audio_sender.h" |
9 #include "media/cast/cast_config.h" | 9 #include "media/cast/cast_config.h" |
10 #include "media/cast/cast_thread.h" | 10 #include "media/cast/cast_thread.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 audio_config.frequency = 48000; | 40 audio_config.frequency = 48000; |
41 audio_config.channels = 2; | 41 audio_config.channels = 2; |
42 audio_config.bitrate = 64000; | 42 audio_config.bitrate = 64000; |
43 audio_config.rtp_payload_type = 127; | 43 audio_config.rtp_payload_type = 127; |
44 | 44 |
45 audio_sender_.reset( | 45 audio_sender_.reset( |
46 new AudioSender(cast_thread_, audio_config, &mock_transport_)); | 46 new AudioSender(cast_thread_, audio_config, &mock_transport_)); |
47 audio_sender_->set_clock(&testing_clock_); | 47 audio_sender_->set_clock(&testing_clock_); |
48 } | 48 } |
49 | 49 |
50 virtual ~AudioSenderTest() {} | 50 ~AudioSenderTest() {} |
51 | 51 |
52 base::SimpleTestTickClock testing_clock_; | 52 base::SimpleTestTickClock testing_clock_; |
53 MockPacedPacketSender mock_transport_; | 53 MockPacedPacketSender mock_transport_; |
54 scoped_refptr<test::FakeTaskRunner> task_runner_; | 54 scoped_refptr<test::FakeTaskRunner> task_runner_; |
55 scoped_ptr<AudioSender> audio_sender_; | 55 scoped_ptr<AudioSender> audio_sender_; |
56 scoped_refptr<CastThread> cast_thread_; | 56 scoped_refptr<CastThread> cast_thread_; |
57 }; | 57 }; |
58 | 58 |
59 TEST_F(AudioSenderTest, Encode20ms) { | 59 TEST_F(AudioSenderTest, Encode20ms) { |
60 EXPECT_CALL(mock_transport_, SendPacket(_, _)).Times(1); | 60 EXPECT_CALL(mock_transport_, SendPacket(_, _)).Times(1); |
(...skipping 15 matching lines...) Expand all Loading... |
76 | 76 |
77 // Make sure that we send at least one RTCP packet. | 77 // Make sure that we send at least one RTCP packet. |
78 base::TimeDelta max_rtcp_timeout = | 78 base::TimeDelta max_rtcp_timeout = |
79 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); | 79 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); |
80 testing_clock_.Advance(max_rtcp_timeout); | 80 testing_clock_.Advance(max_rtcp_timeout); |
81 task_runner_->RunTasks(); | 81 task_runner_->RunTasks(); |
82 } | 82 } |
83 | 83 |
84 } // namespace cast | 84 } // namespace cast |
85 } // namespace media | 85 } // namespace media |
OLD | NEW |