| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/synchronization/condition_variable.h" | 7 #include "base/synchronization/condition_variable.h" |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "base/sys_byteorder.h" | 9 #include "base/sys_byteorder.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 AudioDecoderTest() | 34 AudioDecoderTest() |
| 35 : cast_environment_(new StandaloneCastEnvironment()), | 35 : cast_environment_(new StandaloneCastEnvironment()), |
| 36 cond_(&lock_) {} | 36 cond_(&lock_) {} |
| 37 | 37 |
| 38 virtual ~AudioDecoderTest() { | 38 virtual ~AudioDecoderTest() { |
| 39 // Make sure all threads have stopped before the environment goes away. | 39 // Make sure all threads have stopped before the environment goes away. |
| 40 cast_environment_->Shutdown(); | 40 cast_environment_->Shutdown(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual void SetUp() OVERRIDE { | 44 virtual void SetUp() override { |
| 45 audio_decoder_.reset(new AudioDecoder(cast_environment_, | 45 audio_decoder_.reset(new AudioDecoder(cast_environment_, |
| 46 GetParam().num_channels, | 46 GetParam().num_channels, |
| 47 GetParam().sampling_rate, | 47 GetParam().sampling_rate, |
| 48 GetParam().codec)); | 48 GetParam().codec)); |
| 49 CHECK_EQ(STATUS_AUDIO_INITIALIZED, audio_decoder_->InitializationResult()); | 49 CHECK_EQ(STATUS_AUDIO_INITIALIZED, audio_decoder_->InitializationResult()); |
| 50 | 50 |
| 51 audio_bus_factory_.reset( | 51 audio_bus_factory_.reset( |
| 52 new TestAudioBusFactory(GetParam().num_channels, | 52 new TestAudioBusFactory(GetParam().num_channels, |
| 53 GetParam().sampling_rate, | 53 GetParam().sampling_rate, |
| 54 TestAudioBusFactory::kMiddleANoteFreq, | 54 TestAudioBusFactory::kMiddleANoteFreq, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 AudioDecoderTestScenarios, | 238 AudioDecoderTestScenarios, |
| 239 AudioDecoderTest, | 239 AudioDecoderTest, |
| 240 ::testing::Values( | 240 ::testing::Values( |
| 241 TestScenario(CODEC_AUDIO_PCM16, 1, 8000), | 241 TestScenario(CODEC_AUDIO_PCM16, 1, 8000), |
| 242 TestScenario(CODEC_AUDIO_PCM16, 2, 48000), | 242 TestScenario(CODEC_AUDIO_PCM16, 2, 48000), |
| 243 TestScenario(CODEC_AUDIO_OPUS, 1, 8000), | 243 TestScenario(CODEC_AUDIO_OPUS, 1, 8000), |
| 244 TestScenario(CODEC_AUDIO_OPUS, 2, 48000))); | 244 TestScenario(CODEC_AUDIO_OPUS, 2, 48000))); |
| 245 | 245 |
| 246 } // namespace cast | 246 } // namespace cast |
| 247 } // namespace media | 247 } // namespace media |
| OLD | NEW |