Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: media/base/audio_buffer_converter_unittest.cc

Issue 265943002: Revert of Remove AudioBuffer::set_duration(), instead base on frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/audio_buffer_converter.cc ('k') | media/base/audio_buffer_queue_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/audio_buffer_converter.cc ('k') | media/base/audio_buffer_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698