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/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
9 #include "media/cast/audio_receiver/audio_receiver.h" | 9 #include "media/cast/audio_receiver/audio_receiver.h" |
10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Configure the audio receiver to use PCM16. | 70 // Configure the audio receiver to use PCM16. |
71 audio_config_.rtp_payload_type = 127; | 71 audio_config_.rtp_payload_type = 127; |
72 audio_config_.frequency = 16000; | 72 audio_config_.frequency = 16000; |
73 audio_config_.channels = 1; | 73 audio_config_.channels = 1; |
74 audio_config_.codec = kPcm16; | 74 audio_config_.codec = kPcm16; |
75 audio_config_.use_external_decoder = false; | 75 audio_config_.use_external_decoder = false; |
76 testing_clock_.Advance( | 76 testing_clock_.Advance( |
77 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 77 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
78 task_runner_ = new test::FakeTaskRunner(&testing_clock_); | 78 task_runner_ = new test::FakeTaskRunner(&testing_clock_); |
79 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, | 79 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, |
80 task_runner_, task_runner_, task_runner_, task_runner_); | 80 task_runner_, task_runner_, task_runner_, task_runner_, |
| 81 GetDefaultCastLoggingConfig()); |
81 test_audio_encoder_callback_ = new TestAudioEncoderCallback(); | 82 test_audio_encoder_callback_ = new TestAudioEncoderCallback(); |
82 } | 83 } |
83 | 84 |
84 void Configure(bool use_external_decoder) { | 85 void Configure(bool use_external_decoder) { |
85 audio_config_.use_external_decoder = use_external_decoder; | 86 audio_config_.use_external_decoder = use_external_decoder; |
86 receiver_.reset(new PeerAudioReceiver(cast_environment_, audio_config_, | 87 receiver_.reset(new PeerAudioReceiver(cast_environment_, audio_config_, |
87 &mock_transport_)); | 88 &mock_transport_)); |
88 } | 89 } |
89 | 90 |
90 virtual ~AudioReceiverTest() {} | 91 virtual ~AudioReceiverTest() {} |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 task_runner_->RunTasks(); | 207 task_runner_->RunTasks(); |
207 EXPECT_EQ(3, test_audio_encoder_callback_->number_times_called()); | 208 EXPECT_EQ(3, test_audio_encoder_callback_->number_times_called()); |
208 } | 209 } |
209 | 210 |
210 // TODO(mikhal): Add encoded frames. | 211 // TODO(mikhal): Add encoded frames. |
211 TEST_F(AudioReceiverTest, GetRawFrame) { | 212 TEST_F(AudioReceiverTest, GetRawFrame) { |
212 } | 213 } |
213 | 214 |
214 } // namespace cast | 215 } // namespace cast |
215 } // namespace media | 216 } // namespace media |
OLD | NEW |