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

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

Issue 10855086: Disable AudioOutputMixer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
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 <string> 5 #include <string>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "media/audio/audio_output_dispatcher_impl.h" 10 #include "media/audio/audio_output_dispatcher_impl.h"
11 #include "media/audio/audio_output_mixer.h" 11 //#include "media/audio/audio_output_mixer.h"
scherkus (not reviewing) 2012/08/09 22:12:39 ditto here + below for all the tests
DaleCurtis 2012/08/09 22:46:29 Done.
12 #include "media/audio/audio_output_proxy.h" 12 #include "media/audio/audio_output_proxy.h"
13 #include "media/audio/audio_manager.h" 13 #include "media/audio/audio_manager.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 using ::testing::_; 17 using ::testing::_;
18 using ::testing::AllOf; 18 using ::testing::AllOf;
19 using ::testing::DoAll; 19 using ::testing::DoAll;
20 using ::testing::Field; 20 using ::testing::Field;
21 using ::testing::Mock; 21 using ::testing::Mock;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // closed by the test. 98 // closed by the test.
99 message_loop_.RunAllPending(); 99 message_loop_.RunAllPending();
100 } 100 }
101 101
102 void InitDispatcher(base::TimeDelta close_delay) { 102 void InitDispatcher(base::TimeDelta close_delay) {
103 AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, 103 AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR,
104 CHANNEL_LAYOUT_STEREO, 44100, 16, 1024); 104 CHANNEL_LAYOUT_STEREO, 44100, 16, 1024);
105 dispatcher_impl_ = new AudioOutputDispatcherImpl(&manager(), 105 dispatcher_impl_ = new AudioOutputDispatcherImpl(&manager(),
106 params, 106 params,
107 close_delay); 107 close_delay);
108 mixer_ = new AudioOutputMixer(&manager(), params, close_delay); 108 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
109 // mixer_ = new AudioOutputMixer(&manager(), params, close_delay);
109 110
110 // Necessary to know how long the dispatcher will wait before posting 111 // Necessary to know how long the dispatcher will wait before posting
111 // StopStreamTask. 112 // StopStreamTask.
112 pause_delay_ = dispatcher_impl_->pause_delay_; 113 pause_delay_ = dispatcher_impl_->pause_delay_;
113 } 114 }
114 115
115 MockAudioManager& manager() { 116 MockAudioManager& manager() {
116 return manager_; 117 return manager_;
117 } 118 }
118 119
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 .Times(1); 234 .Times(1);
234 235
235 AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher); 236 AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher);
236 EXPECT_FALSE(proxy->Open()); 237 EXPECT_FALSE(proxy->Open());
237 proxy->Close(); 238 proxy->Close();
238 WaitForCloseTimer(kTestCloseDelayMs); 239 WaitForCloseTimer(kTestCloseDelayMs);
239 } 240 }
240 241
241 MessageLoop message_loop_; 242 MessageLoop message_loop_;
242 scoped_refptr<AudioOutputDispatcherImpl> dispatcher_impl_; 243 scoped_refptr<AudioOutputDispatcherImpl> dispatcher_impl_;
243 scoped_refptr<AudioOutputMixer> mixer_; 244 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
245 // scoped_refptr<AudioOutputMixer> mixer_;
244 base::TimeDelta pause_delay_; 246 base::TimeDelta pause_delay_;
245 MockAudioManager manager_; 247 MockAudioManager manager_;
246 MockAudioSourceCallback callback_; 248 MockAudioSourceCallback callback_;
247 }; 249 };
248 250
249 TEST_F(AudioOutputProxyTest, CreateAndClose) { 251 TEST_F(AudioOutputProxyTest, CreateAndClose) {
250 AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher_impl_); 252 AudioOutputProxy* proxy = new AudioOutputProxy(dispatcher_impl_);
251 proxy->Close(); 253 proxy->Close();
252 } 254 }
253 255
254 TEST_F(AudioOutputProxyTest, CreateAndClose_Mixer) { 256 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
255 AudioOutputProxy* proxy = new AudioOutputProxy(mixer_); 257 // TEST_F(AudioOutputProxyTest, CreateAndClose_Mixer) {
256 proxy->Close(); 258 // AudioOutputProxy* proxy = new AudioOutputProxy(mixer_);
257 } 259 // proxy->Close();
260 // }
258 261
259 TEST_F(AudioOutputProxyTest, OpenAndClose) { 262 TEST_F(AudioOutputProxyTest, OpenAndClose) {
260 OpenAndClose(dispatcher_impl_); 263 OpenAndClose(dispatcher_impl_);
261 } 264 }
262 265
263 TEST_F(AudioOutputProxyTest, OpenAndClose_Mixer) { 266 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
264 OpenAndClose(mixer_); 267 // TEST_F(AudioOutputProxyTest, OpenAndClose_Mixer) {
265 } 268 // OpenAndClose(mixer_);
269 // }
266 270
267 // Create a stream, and verify that it is closed after kTestCloseDelayMs. 271 // Create a stream, and verify that it is closed after kTestCloseDelayMs.
268 // if it doesn't start playing. 272 // if it doesn't start playing.
269 TEST_F(AudioOutputProxyTest, CreateAndWait) { 273 TEST_F(AudioOutputProxyTest, CreateAndWait) {
270 MockAudioOutputStream stream; 274 MockAudioOutputStream stream;
271 275
272 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 276 EXPECT_CALL(manager(), MakeAudioOutputStream(_))
273 .WillOnce(Return(&stream)); 277 .WillOnce(Return(&stream));
274 EXPECT_CALL(stream, Open()) 278 EXPECT_CALL(stream, Open())
275 .WillOnce(Return(true)); 279 .WillOnce(Return(true));
(...skipping 11 matching lines...) Expand all
287 // Verify expectation before calling Close(). 291 // Verify expectation before calling Close().
288 Mock::VerifyAndClear(&stream); 292 Mock::VerifyAndClear(&stream);
289 293
290 proxy->Close(); 294 proxy->Close();
291 } 295 }
292 296
293 TEST_F(AudioOutputProxyTest, StartAndStop) { 297 TEST_F(AudioOutputProxyTest, StartAndStop) {
294 StartAndStop(dispatcher_impl_); 298 StartAndStop(dispatcher_impl_);
295 } 299 }
296 300
297 TEST_F(AudioOutputProxyTest, StartAndStop_Mixer) { 301 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
298 StartAndStop(mixer_); 302 // TEST_F(AudioOutputProxyTest, StartAndStop_Mixer) {
299 } 303 // StartAndStop(mixer_);
304 // }
300 305
301 TEST_F(AudioOutputProxyTest, CloseAfterStop) { 306 TEST_F(AudioOutputProxyTest, CloseAfterStop) {
302 CloseAfterStop(dispatcher_impl_); 307 CloseAfterStop(dispatcher_impl_);
303 } 308 }
304 309
305 TEST_F(AudioOutputProxyTest, CloseAfterStop_Mixer) { 310 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
306 CloseAfterStop(mixer_); 311 // TEST_F(AudioOutputProxyTest, CloseAfterStop_Mixer) {
307 } 312 // CloseAfterStop(mixer_);
313 // }
308 314
309 TEST_F(AudioOutputProxyTest, TwoStreams) { 315 TEST_F(AudioOutputProxyTest, TwoStreams) {
310 TwoStreams(dispatcher_impl_); 316 TwoStreams(dispatcher_impl_);
311 } 317 }
312 318
313 TEST_F(AudioOutputProxyTest, TwoStreams_Mixer) { 319 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
314 TwoStreams(mixer_); 320 // TEST_F(AudioOutputProxyTest, TwoStreams_Mixer) {
315 } 321 // TwoStreams(mixer_);
322 // }
316 323
317 // Two streams: verify that second stream is allocated when the first 324 // Two streams: verify that second stream is allocated when the first
318 // starts playing. 325 // starts playing.
319 TEST_F(AudioOutputProxyTest, TwoStreams_OnePlaying) { 326 TEST_F(AudioOutputProxyTest, TwoStreams_OnePlaying) {
320 MockAudioOutputStream stream1; 327 MockAudioOutputStream stream1;
321 MockAudioOutputStream stream2; 328 MockAudioOutputStream stream2;
322 329
323 InitDispatcher(base::TimeDelta::FromSeconds(kTestBigCloseDelaySeconds)); 330 InitDispatcher(base::TimeDelta::FromSeconds(kTestBigCloseDelaySeconds));
324 331
325 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 332 EXPECT_CALL(manager(), MakeAudioOutputStream(_))
(...skipping 22 matching lines...) Expand all
348 EXPECT_TRUE(proxy2->Open()); 355 EXPECT_TRUE(proxy2->Open());
349 356
350 proxy1->Start(&callback_); 357 proxy1->Start(&callback_);
351 message_loop_.RunAllPending(); 358 message_loop_.RunAllPending();
352 proxy1->Stop(); 359 proxy1->Stop();
353 360
354 proxy1->Close(); 361 proxy1->Close();
355 proxy2->Close(); 362 proxy2->Close();
356 } 363 }
357 364
358 // Two streams: verify that only one device will be created. 365 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
359 TEST_F(AudioOutputProxyTest, TwoStreams_OnePlaying_Mixer) { 366 // // Two streams: verify that only one device will be created.
360 MockAudioOutputStream stream; 367 // TEST_F(AudioOutputProxyTest, TwoStreams_OnePlaying_Mixer) {
368 // MockAudioOutputStream stream;
361 369
362 InitDispatcher(base::TimeDelta::FromMilliseconds(kTestCloseDelayMs)); 370 // InitDispatcher(base::TimeDelta::FromMilliseconds(kTestCloseDelayMs));
363 371
364 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 372 // EXPECT_CALL(manager(), MakeAudioOutputStream(_))
365 .WillOnce(Return(&stream)); 373 // .WillOnce(Return(&stream));
366 374
367 EXPECT_CALL(stream, Open()) 375 // EXPECT_CALL(stream, Open())
368 .WillOnce(Return(true)); 376 // .WillOnce(Return(true));
369 EXPECT_CALL(stream, Start(_)) 377 // EXPECT_CALL(stream, Start(_))
370 .Times(1); 378 // .Times(1);
371 EXPECT_CALL(stream, SetVolume(_)) 379 // EXPECT_CALL(stream, SetVolume(_))
372 .Times(1); 380 // .Times(1);
373 EXPECT_CALL(stream, Stop()) 381 // EXPECT_CALL(stream, Stop())
374 .Times(1); 382 // .Times(1);
375 EXPECT_CALL(stream, Close()) 383 // EXPECT_CALL(stream, Close())
376 .Times(1); 384 // .Times(1);
377 385
378 AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_); 386 // AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_);
379 AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_); 387 // AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_);
380 EXPECT_TRUE(proxy1->Open()); 388 // EXPECT_TRUE(proxy1->Open());
381 EXPECT_TRUE(proxy2->Open()); 389 // EXPECT_TRUE(proxy2->Open());
382 390
383 proxy1->Start(&callback_); 391 // proxy1->Start(&callback_);
384 proxy1->Stop(); 392 // proxy1->Stop();
385 393
386 proxy1->Close(); 394 // proxy1->Close();
387 proxy2->Close(); 395 // proxy2->Close();
388 WaitForCloseTimer(kTestCloseDelayMs); 396 // WaitForCloseTimer(kTestCloseDelayMs);
389 } 397 // }
390 398
391 // Two streams, both are playing. Dispatcher should not open a third stream. 399 // Two streams, both are playing. Dispatcher should not open a third stream.
392 TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying) { 400 TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying) {
393 MockAudioOutputStream stream1; 401 MockAudioOutputStream stream1;
394 MockAudioOutputStream stream2; 402 MockAudioOutputStream stream2;
395 403
396 InitDispatcher(base::TimeDelta::FromSeconds(kTestBigCloseDelaySeconds)); 404 InitDispatcher(base::TimeDelta::FromSeconds(kTestBigCloseDelaySeconds));
397 405
398 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 406 EXPECT_CALL(manager(), MakeAudioOutputStream(_))
399 .WillOnce(Return(&stream1)) 407 .WillOnce(Return(&stream1))
(...skipping 28 matching lines...) Expand all
428 436
429 proxy1->Start(&callback_); 437 proxy1->Start(&callback_);
430 proxy2->Start(&callback_); 438 proxy2->Start(&callback_);
431 proxy1->Stop(); 439 proxy1->Stop();
432 proxy2->Stop(); 440 proxy2->Stop();
433 441
434 proxy1->Close(); 442 proxy1->Close();
435 proxy2->Close(); 443 proxy2->Close();
436 } 444 }
437 445
438 // Two streams, both are playing. Still have to use single device. 446 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
439 // Also verifies that every proxy stream gets its own pending_bytes. 447 // // Two streams, both are playing. Still have to use single device.
440 TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying_Mixer) { 448 // // Also verifies that every proxy stream gets its own pending_bytes.
441 MockAudioOutputStream stream; 449 // TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying_Mixer) {
450 // MockAudioOutputStream stream;
442 451
443 InitDispatcher(base::TimeDelta::FromMilliseconds(kTestCloseDelayMs)); 452 // InitDispatcher(base::TimeDelta::FromMilliseconds(kTestCloseDelayMs));
444 453
445 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 454 // EXPECT_CALL(manager(), MakeAudioOutputStream(_))
446 .WillOnce(Return(&stream)); 455 // .WillOnce(Return(&stream));
447 456
448 EXPECT_CALL(stream, Open()) 457 // EXPECT_CALL(stream, Open())
449 .WillOnce(Return(true)); 458 // .WillOnce(Return(true));
450 EXPECT_CALL(stream, Start(_)) 459 // EXPECT_CALL(stream, Start(_))
451 .Times(1); 460 // .Times(1);
452 EXPECT_CALL(stream, SetVolume(_)) 461 // EXPECT_CALL(stream, SetVolume(_))
453 .Times(1); 462 // .Times(1);
454 EXPECT_CALL(stream, Stop()) 463 // EXPECT_CALL(stream, Stop())
455 .Times(1); 464 // .Times(1);
456 EXPECT_CALL(stream, Close()) 465 // EXPECT_CALL(stream, Close())
457 .Times(1); 466 // .Times(1);
458 467
459 AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_); 468 // AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_);
460 AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_); 469 // AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_);
461 EXPECT_TRUE(proxy1->Open()); 470 // EXPECT_TRUE(proxy1->Open());
462 EXPECT_TRUE(proxy2->Open()); 471 // EXPECT_TRUE(proxy2->Open());
463 472
464 proxy1->Start(&callback_); 473 // proxy1->Start(&callback_);
465 474
466 // Mute the proxy. Resulting stream should still have correct length. 475 // // Mute the proxy. Resulting stream should still have correct length.
467 proxy1->SetVolume(0.0); 476 // proxy1->SetVolume(0.0);
468 477
469 uint8 zeroes[4] = {0, 0, 0, 0}; 478 // uint8 zeroes[4] = {0, 0, 0, 0};
470 uint8 buf1[4] = {0}; 479 // uint8 buf1[4] = {0};
471 EXPECT_CALL(callback_, 480 // EXPECT_CALL(callback_,
472 OnMoreData(NotNull(), 4, 481 // OnMoreData(NotNull(), 4,
473 AllOf(Field(&AudioBuffersState::pending_bytes, 0), 482 // AllOf(Field(&AudioBuffersState::pending_bytes, 0),
474 Field(&AudioBuffersState::hardware_delay_bytes, 0)))) 483 // Field(&AudioBuffersState::hardware_delay_bytes, 0))))
475 .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)), 484 // .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
476 Return(4))); 485 // Return(4)));
477 mixer_->OnMoreData(buf1, sizeof(buf1), AudioBuffersState(0, 0)); 486 // mixer_->OnMoreData(buf1, sizeof(buf1), AudioBuffersState(0, 0));
478 proxy2->Start(&callback_); 487 // proxy2->Start(&callback_);
479 uint8 buf2[4] = {0}; 488 // uint8 buf2[4] = {0};
480 EXPECT_CALL(callback_, 489 // EXPECT_CALL(callback_,
481 OnMoreData(NotNull(), 4, 490 // OnMoreData(NotNull(), 4,
482 AllOf(Field(&AudioBuffersState::pending_bytes, 4), 491 // AllOf(Field(&AudioBuffersState::pending_bytes, 4),
483 Field(&AudioBuffersState::hardware_delay_bytes, 0)))) 492 // Field(&AudioBuffersState::hardware_delay_bytes, 0))))
484 .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)), 493 // .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
485 Return(4))); 494 // Return(4)));
486 EXPECT_CALL(callback_, 495 // EXPECT_CALL(callback_,
487 OnMoreData(NotNull(), 4, 496 // OnMoreData(NotNull(), 4,
488 AllOf(Field(&AudioBuffersState::pending_bytes, 0), 497 // AllOf(Field(&AudioBuffersState::pending_bytes, 0),
489 Field(&AudioBuffersState::hardware_delay_bytes, 0)))) 498 // Field(&AudioBuffersState::hardware_delay_bytes, 0))))
490 .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)), 499 // .WillOnce(DoAll(SetArrayArgument<0>(zeroes, zeroes + sizeof(zeroes)),
491 Return(4))); 500 // Return(4)));
492 mixer_->OnMoreData(buf2, sizeof(buf2), AudioBuffersState(4, 0)); 501 // mixer_->OnMoreData(buf2, sizeof(buf2), AudioBuffersState(4, 0));
493 proxy1->Stop(); 502 // proxy1->Stop();
494 proxy2->Stop(); 503 // proxy2->Stop();
495 504
496 proxy1->Close(); 505 // proxy1->Close();
497 proxy2->Close(); 506 // proxy2->Close();
498 WaitForCloseTimer(kTestCloseDelayMs); 507 // WaitForCloseTimer(kTestCloseDelayMs);
499 } 508 // }
500 509
501 TEST_F(AudioOutputProxyTest, OpenFailed) { 510 TEST_F(AudioOutputProxyTest, OpenFailed) {
502 OpenFailed(dispatcher_impl_); 511 OpenFailed(dispatcher_impl_);
503 } 512 }
504 513
505 TEST_F(AudioOutputProxyTest, OpenFailed_Mixer) { 514 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
506 OpenFailed(mixer_); 515 // TEST_F(AudioOutputProxyTest, OpenFailed_Mixer) {
507 } 516 // OpenFailed(mixer_);
517 // }
508 518
509 // Start() method failed. 519 // Start() method failed.
510 TEST_F(AudioOutputProxyTest, StartFailed) { 520 TEST_F(AudioOutputProxyTest, StartFailed) {
511 MockAudioOutputStream stream; 521 MockAudioOutputStream stream;
512 522
513 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 523 EXPECT_CALL(manager(), MakeAudioOutputStream(_))
514 .WillOnce(Return(&stream)); 524 .WillOnce(Return(&stream));
515 EXPECT_CALL(stream, Open()) 525 EXPECT_CALL(stream, Open())
516 .WillOnce(Return(true)); 526 .WillOnce(Return(true));
517 EXPECT_CALL(stream, Close()) 527 EXPECT_CALL(stream, Close())
(...skipping 17 matching lines...) Expand all
535 EXPECT_CALL(callback_, OnError(_, _)) 545 EXPECT_CALL(callback_, OnError(_, _))
536 .Times(1); 546 .Times(1);
537 547
538 proxy->Start(&callback_); 548 proxy->Start(&callback_);
539 549
540 Mock::VerifyAndClear(&callback_); 550 Mock::VerifyAndClear(&callback_);
541 551
542 proxy->Close(); 552 proxy->Close();
543 } 553 }
544 554
555 // TODO(dalecurtis): Temporarily disabled while switching over to floats.
545 // Start() method failed. 556 // Start() method failed.
546 TEST_F(AudioOutputProxyTest, StartFailed_Mixer) { 557 // TEST_F(AudioOutputProxyTest, StartFailed_Mixer) {
547 MockAudioOutputStream stream; 558 // MockAudioOutputStream stream;
548 559
549 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 560 // EXPECT_CALL(manager(), MakeAudioOutputStream(_))
550 .WillOnce(Return(&stream)); 561 // .WillOnce(Return(&stream));
551 EXPECT_CALL(stream, Open()) 562 // EXPECT_CALL(stream, Open())
552 .WillOnce(Return(true)); 563 // .WillOnce(Return(true));
553 EXPECT_CALL(stream, Close()) 564 // EXPECT_CALL(stream, Close())
554 .Times(1); 565 // .Times(1);
555 EXPECT_CALL(stream, Start(_)) 566 // EXPECT_CALL(stream, Start(_))
556 .Times(1); 567 // .Times(1);
557 EXPECT_CALL(stream, SetVolume(_)) 568 // EXPECT_CALL(stream, SetVolume(_))
558 .Times(1); 569 // .Times(1);
559 EXPECT_CALL(stream, Stop()) 570 // EXPECT_CALL(stream, Stop())
560 .Times(1); 571 // .Times(1);
561 572
562 AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_); 573 // AudioOutputProxy* proxy1 = new AudioOutputProxy(mixer_);
563 AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_); 574 // AudioOutputProxy* proxy2 = new AudioOutputProxy(mixer_);
564 EXPECT_TRUE(proxy1->Open()); 575 // EXPECT_TRUE(proxy1->Open());
565 EXPECT_TRUE(proxy2->Open()); 576 // EXPECT_TRUE(proxy2->Open());
566 proxy1->Start(&callback_); 577 // proxy1->Start(&callback_);
567 proxy1->Stop(); 578 // proxy1->Stop();
568 proxy1->Close(); 579 // proxy1->Close();
569 WaitForCloseTimer(kTestCloseDelayMs); 580 // WaitForCloseTimer(kTestCloseDelayMs);
570 581
571 // Verify expectation before continueing. 582 // // Verify expectation before continueing.
572 Mock::VerifyAndClear(&stream); 583 // Mock::VerifyAndClear(&stream);
573 584
574 // |stream| is closed at this point. Start() should reopen it again. 585 // // |stream| is closed at this point. Start() should reopen it again.
575 EXPECT_CALL(manager(), MakeAudioOutputStream(_)) 586 // EXPECT_CALL(manager(), MakeAudioOutputStream(_))
576 .WillOnce(Return(reinterpret_cast<AudioOutputStream*>(NULL))); 587 // .WillOnce(Return(reinterpret_cast<AudioOutputStream*>(NULL)));
577 588
578 EXPECT_CALL(callback_, OnError(_, _)) 589 // EXPECT_CALL(callback_, OnError(_, _))
579 .Times(1); 590 // .Times(1);
580 591
581 proxy2->Start(&callback_); 592 // proxy2->Start(&callback_);
582 593
583 Mock::VerifyAndClear(&callback_); 594 // Mock::VerifyAndClear(&callback_);
584 595
585 proxy2->Close(); 596 // proxy2->Close();
586 WaitForCloseTimer(kTestCloseDelayMs); 597 // WaitForCloseTimer(kTestCloseDelayMs);
587 } 598 // }
588 599
589 } // namespace media 600 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698