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

Side by Side Diff: content/renderer/media/audio_renderer_impl_unittest.cc

Issue 7867051: Introduce AudioDecoderConfig to migrate away from GetAVStream(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: samples_per_second Created 9 years, 3 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 | « no previous file | media/base/audio_decoder_config.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/process_util.h" 6 #include "base/process_util.h"
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "content/common/child_process.h" 10 #include "content/common/child_process.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Create temporary shared memory. 151 // Create temporary shared memory.
152 CHECK(shared_mem_.CreateAnonymous(kSize)); 152 CHECK(shared_mem_.CreateAnonymous(kSize));
153 153
154 // Setup expectations for initialization. 154 // Setup expectations for initialization.
155 decoder_ = new media::MockAudioDecoder(); 155 decoder_ = new media::MockAudioDecoder();
156 156
157 EXPECT_CALL(*decoder_, bits_per_channel()) 157 EXPECT_CALL(*decoder_, bits_per_channel())
158 .WillRepeatedly(Return(16)); 158 .WillRepeatedly(Return(16));
159 EXPECT_CALL(*decoder_, channel_layout()) 159 EXPECT_CALL(*decoder_, channel_layout())
160 .WillRepeatedly(Return(CHANNEL_LAYOUT_MONO)); 160 .WillRepeatedly(Return(CHANNEL_LAYOUT_MONO));
161 EXPECT_CALL(*decoder_, sample_rate()) 161 EXPECT_CALL(*decoder_, samples_per_second())
162 .WillRepeatedly(Return(44100)); 162 .WillRepeatedly(Return(44100));
163 163
164 // Create and initialize the audio renderer. 164 // Create and initialize the audio renderer.
165 renderer_ = new TestAudioRendererImpl(); 165 renderer_ = new TestAudioRendererImpl();
166 renderer_->set_host(&host_); 166 renderer_->set_host(&host_);
167 renderer_->Initialize(decoder_, media::NewExpectedCallback()); 167 renderer_->Initialize(decoder_, media::NewExpectedCallback());
168 168
169 // Wraps delegate calls into tasks. 169 // Wraps delegate calls into tasks.
170 delegate_caller_ = new DelegateCaller(renderer_); 170 delegate_caller_ = new DelegateCaller(renderer_);
171 171
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 base::Time time_now = base::Time(); // Null time by default. 339 base::Time time_now = base::Time(); // Null time by default.
340 renderer_->set_earliest_end_time(time_now); 340 renderer_->set_earliest_end_time(time_now);
341 renderer_->UpdateEarliestEndTime(renderer_->bytes_per_second(), 341 renderer_->UpdateEarliestEndTime(renderer_->bytes_per_second(),
342 base::TimeDelta::FromMilliseconds(100), 342 base::TimeDelta::FromMilliseconds(100),
343 time_now); 343 time_now);
344 int time_delta = (renderer_->earliest_end_time() - time_now).InMilliseconds(); 344 int time_delta = (renderer_->earliest_end_time() - time_now).InMilliseconds();
345 EXPECT_EQ(1100, time_delta); 345 EXPECT_EQ(1100, time_delta);
346 renderer_->Stop(media::NewExpectedCallback()); 346 renderer_->Stop(media::NewExpectedCallback());
347 WaitForIOThreadCompletion(); 347 WaitForIOThreadCompletion();
348 } 348 }
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698