| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "media/base/audio_buffer.h" | 6 #include "media/base/audio_buffer.h" |
| 7 #include "media/base/audio_buffer_converter.h" | 7 #include "media/base/audio_buffer_converter.h" |
| 8 #include "media/base/sinc_resampler.h" | 8 #include "media/base/sinc_resampler.h" |
| 9 #include "media/base/test_helpers.h" | 9 #include "media/base/test_helpers.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 ChannelLayout channel_layout, | 22 ChannelLayout channel_layout, |
| 23 int channel_count, | 23 int channel_count, |
| 24 int frames) { | 24 int frames) { |
| 25 return MakeAudioBuffer<uint8>(kSampleFormatU8, | 25 return MakeAudioBuffer<uint8>(kSampleFormatU8, |
| 26 channel_layout, | 26 channel_layout, |
| 27 channel_count, | 27 channel_count, |
| 28 sample_rate, | 28 sample_rate, |
| 29 0, | 29 0, |
| 30 1, | 30 1, |
| 31 frames, | 31 frames, |
| 32 base::TimeDelta::FromSeconds(0), |
| 32 base::TimeDelta::FromSeconds(0)); | 33 base::TimeDelta::FromSeconds(0)); |
| 33 } | 34 } |
| 34 | 35 |
| 35 class AudioBufferConverterTest : public ::testing::Test { | 36 class AudioBufferConverterTest : public ::testing::Test { |
| 36 public: | 37 public: |
| 37 AudioBufferConverterTest() | 38 AudioBufferConverterTest() |
| 38 : input_frames_(0), | 39 : input_frames_(0), |
| 39 expected_output_frames_(0.0), | 40 expected_output_frames_(0.0), |
| 40 output_frames_(0), | 41 output_frames_(0), |
| 41 output_params_(AudioParameters::AUDIO_PCM_LOW_LATENCY, | 42 output_params_(AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 247 |
| 247 // Since the input buffer size is a multiple of the input request size there | 248 // Since the input buffer size is a multiple of the input request size there |
| 248 // should never be any frames remaining at this point. | 249 // should never be any frames remaining at this point. |
| 249 ASSERT_EQ(kInputFrameSize % | 250 ASSERT_EQ(kInputFrameSize % |
| 250 audio_buffer_converter_->input_buffer_size_for_testing(), | 251 audio_buffer_converter_->input_buffer_size_for_testing(), |
| 251 0); | 252 0); |
| 252 EXPECT_EQ(0, audio_buffer_converter_->input_frames_left_for_testing()); | 253 EXPECT_EQ(0, audio_buffer_converter_->input_frames_left_for_testing()); |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace media | 256 } // namespace media |
| OLD | NEW |