| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 audio_config_.frequency = 16000; | 73 audio_config_.frequency = 16000; |
| 74 audio_config_.channels = 1; | 74 audio_config_.channels = 1; |
| 75 audio_config_.codec = transport::kPcm16; | 75 audio_config_.codec = transport::kPcm16; |
| 76 audio_config_.use_external_decoder = false; | 76 audio_config_.use_external_decoder = false; |
| 77 audio_config_.feedback_ssrc = 1234; | 77 audio_config_.feedback_ssrc = 1234; |
| 78 testing_clock_.Advance( | 78 testing_clock_.Advance( |
| 79 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 79 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 80 task_runner_ = new test::FakeTaskRunner(&testing_clock_); | 80 task_runner_ = new test::FakeTaskRunner(&testing_clock_); |
| 81 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, | 81 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, |
| 82 task_runner_, task_runner_, task_runner_, task_runner_, | 82 task_runner_, task_runner_, task_runner_, task_runner_, |
| 83 task_runner_, GetDefaultCastLoggingConfig()); | 83 task_runner_, GetDefaultCastReceiverLoggingConfig()); |
| 84 test_audio_encoder_callback_ = new TestAudioEncoderCallback(); | 84 test_audio_encoder_callback_ = new TestAudioEncoderCallback(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void Configure(bool use_external_decoder) { | 87 void Configure(bool use_external_decoder) { |
| 88 audio_config_.use_external_decoder = use_external_decoder; | 88 audio_config_.use_external_decoder = use_external_decoder; |
| 89 receiver_.reset(new PeerAudioReceiver(cast_environment_, audio_config_, | 89 receiver_.reset(new PeerAudioReceiver(cast_environment_, audio_config_, |
| 90 &mock_transport_)); | 90 &mock_transport_)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 virtual ~AudioReceiverTest() {} | 93 virtual ~AudioReceiverTest() {} |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 task_runner_->RunTasks(); | 209 task_runner_->RunTasks(); |
| 210 EXPECT_EQ(3, test_audio_encoder_callback_->number_times_called()); | 210 EXPECT_EQ(3, test_audio_encoder_callback_->number_times_called()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 // TODO(mikhal): Add encoded frames. | 213 // TODO(mikhal): Add encoded frames. |
| 214 TEST_F(AudioReceiverTest, GetRawFrame) { | 214 TEST_F(AudioReceiverTest, GetRawFrame) { |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace cast | 217 } // namespace cast |
| 218 } // namespace media | 218 } // namespace media |
| OLD | NEW |