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

Side by Side Diff: media/audio/audio_output_controller_unittest.cc

Issue 10540034: Use 2 buffers on presumable good Windows boxes. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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/audio/audio_util.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) 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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/environment.h" 6 #include "base/environment.h"
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 EXPECT_CALL(event_handler, OnPlaying(NotNull())) 189 EXPECT_CALL(event_handler, OnPlaying(NotNull()))
190 .WillOnce(InvokeWithoutArgs(&play_event, &base::WaitableEvent::Signal)); 190 .WillOnce(InvokeWithoutArgs(&play_event, &base::WaitableEvent::Signal));
191 191
192 // OnPaused() should never be called since the pause during kStarting is 192 // OnPaused() should never be called since the pause during kStarting is
193 // dropped when the second play comes in. 193 // dropped when the second play comes in.
194 EXPECT_CALL(event_handler, OnPaused(NotNull())) 194 EXPECT_CALL(event_handler, OnPaused(NotNull()))
195 .Times(0); 195 .Times(0);
196 196
197 MockAudioOutputControllerSyncReader sync_reader; 197 MockAudioOutputControllerSyncReader sync_reader;
198 EXPECT_CALL(sync_reader, UpdatePendingBytes(_)) 198 EXPECT_CALL(sync_reader, UpdatePendingBytes(_))
199 .Times(AtLeast(2)); 199 .Times(AtLeast(1));
200 EXPECT_CALL(sync_reader, Read(_, kHardwareBufferSize)) 200 EXPECT_CALL(sync_reader, Read(_, kHardwareBufferSize))
201 .WillRepeatedly(DoAll(SignalEvent(&event), Return(4))); 201 .WillRepeatedly(DoAll(SignalEvent(&event), Return(4)));
202 EXPECT_CALL(sync_reader, DataReady()) 202 EXPECT_CALL(sync_reader, DataReady())
203 .WillRepeatedly(Return(true)); 203 .WillRepeatedly(Return(true));
204 EXPECT_CALL(sync_reader, Close()); 204 EXPECT_CALL(sync_reader, Close());
205 205
206 AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, 206 AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout,
207 kSampleRate, kBitsPerSample, kSamplesPerPacket); 207 kSampleRate, kBitsPerSample, kSamplesPerPacket);
208 scoped_refptr<AudioOutputController> controller = 208 scoped_refptr<AudioOutputController> controller =
209 AudioOutputController::Create( 209 AudioOutputController::Create(
210 audio_manager.get(), &event_handler, params, &sync_reader); 210 audio_manager.get(), &event_handler, params, &sync_reader);
211 ASSERT_TRUE(controller.get()); 211 ASSERT_TRUE(controller.get());
212 212
213 // Wait for OnCreated() to be called. 213 // Wait for OnCreated() to be called.
214 event.Wait(); 214 event.Wait();
215 215
216 ASSERT_FALSE(play_event.IsSignaled()); 216 ASSERT_FALSE(play_event.IsSignaled());
217 controller->Play(); 217 controller->Play();
218 controller->Pause(); 218 controller->Pause();
219 controller->Play(); 219 controller->Play();
220 play_event.Wait(); 220 play_event.Wait();
221 221
222 // Now stop the controller. 222 // Now stop the controller.
223 CloseAudioController(controller); 223 CloseAudioController(controller);
224 } 224 }
225 225
226 } // namespace media 226 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698