| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
| 6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 half_fill_(false) { | 44 half_fill_(false) { |
| 45 // Create input and output parameters based on test parameters. | 45 // Create input and output parameters based on test parameters. |
| 46 input_parameters_ = AudioParameters( | 46 input_parameters_ = AudioParameters( |
| 47 AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, | 47 AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, |
| 48 std::tr1::get<0>(GetParam()), kBitsPerChannel, kHighLatencyBufferSize); | 48 std::tr1::get<0>(GetParam()), kBitsPerChannel, kHighLatencyBufferSize); |
| 49 output_parameters_ = AudioParameters( | 49 output_parameters_ = AudioParameters( |
| 50 AudioParameters::AUDIO_PCM_LOW_LATENCY, kChannelLayout, | 50 AudioParameters::AUDIO_PCM_LOW_LATENCY, kChannelLayout, |
| 51 std::tr1::get<1>(GetParam()), 16, kLowLatencyBufferSize); | 51 std::tr1::get<1>(GetParam()), 16, kLowLatencyBufferSize); |
| 52 | 52 |
| 53 sink_ = new MockAudioRendererSink(); | 53 sink_ = new MockAudioRendererSink(); |
| 54 EXPECT_CALL(*sink_, Start()); | 54 EXPECT_CALL(*sink_.get(), Start()); |
| 55 EXPECT_CALL(*sink_, Stop()); | 55 EXPECT_CALL(*sink_.get(), Stop()); |
| 56 | 56 |
| 57 mixer_.reset(new AudioRendererMixer( | 57 mixer_.reset(new AudioRendererMixer( |
| 58 input_parameters_, output_parameters_, sink_)); | 58 input_parameters_, output_parameters_, sink_)); |
| 59 mixer_callback_ = sink_->callback(); | 59 mixer_callback_ = sink_->callback(); |
| 60 | 60 |
| 61 audio_bus_ = AudioBus::Create(output_parameters_); | 61 audio_bus_ = AudioBus::Create(output_parameters_); |
| 62 expected_audio_bus_ = AudioBus::Create(output_parameters_); | 62 expected_audio_bus_ = AudioBus::Create(output_parameters_); |
| 63 | 63 |
| 64 // Allocate one callback for generating expected results. | 64 // Allocate one callback for generating expected results. |
| 65 double step = kSineCycles / static_cast<double>( | 65 double step = kSineCycles / static_cast<double>( |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 // Test cases for behavior which is independent of parameters. Values() doesn't | 475 // Test cases for behavior which is independent of parameters. Values() doesn't |
| 476 // support single item lists and we don't want these test cases to run for every | 476 // support single item lists and we don't want these test cases to run for every |
| 477 // parameter set. | 477 // parameter set. |
| 478 INSTANTIATE_TEST_CASE_P( | 478 INSTANTIATE_TEST_CASE_P( |
| 479 AudioRendererMixerBehavioralTest, AudioRendererMixerBehavioralTest, | 479 AudioRendererMixerBehavioralTest, AudioRendererMixerBehavioralTest, |
| 480 testing::ValuesIn(std::vector<AudioRendererMixerTestData>( | 480 testing::ValuesIn(std::vector<AudioRendererMixerTestData>( |
| 481 1, std::tr1::make_tuple(44100, 44100, 0)))); | 481 1, std::tr1::make_tuple(44100, 44100, 0)))); |
| 482 | 482 |
| 483 } // namespace media | 483 } // namespace media |
| OLD | NEW |