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

Side by Side Diff: media/audio/win/audio_low_latency_output_win_unittest.cc

Issue 1487733003: Allow multiple OnMoreData() calls in WASAPIAudioOutputStreamTest.ValidPacketSize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Let there be just one quit message Created 5 years 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
« no previous file with comments | « no previous file | no next file » | 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 <windows.h> 5 #include <windows.h>
6 #include <mmsystem.h> 6 #include <mmsystem.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // Create default WASAPI output stream which plays out in stereo using 373 // Create default WASAPI output stream which plays out in stereo using
374 // the shared mixing rate. The default buffer size is 10ms. 374 // the shared mixing rate. The default buffer size is 10ms.
375 AudioOutputStreamWrapper aosw(audio_manager.get()); 375 AudioOutputStreamWrapper aosw(audio_manager.get());
376 AudioOutputStream* aos = aosw.Create(); 376 AudioOutputStream* aos = aosw.Create();
377 EXPECT_TRUE(aos->Open()); 377 EXPECT_TRUE(aos->Open());
378 378
379 // Derive the expected size in bytes of each packet. 379 // Derive the expected size in bytes of each packet.
380 uint32 bytes_per_packet = aosw.channels() * aosw.samples_per_packet() * 380 uint32 bytes_per_packet = aosw.channels() * aosw.samples_per_packet() *
381 (aosw.bits_per_sample() / 8); 381 (aosw.bits_per_sample() / 8);
382 382
383 // Wait for the first callback and verify its parameters. 383 // Wait for the first callback and verify its parameters. Ignore any
384 // subsequent callbacks that might arrive.
384 EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet))) 385 EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
385 .WillOnce(DoAll(QuitLoop(loop.task_runner()), 386 .WillOnce(DoAll(QuitLoop(loop.task_runner()),
386 Return(aosw.samples_per_packet()))); 387 Return(aosw.samples_per_packet())))
388 .WillRepeatedly(Return(0));
387 389
388 aos->Start(&source); 390 aos->Start(&source);
389 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), 391 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
390 TestTimeouts::action_timeout()); 392 TestTimeouts::action_timeout());
391 loop.Run(); 393 loop.Run();
392 aos->Stop(); 394 aos->Stop();
393 aos->Close(); 395 aos->Close();
394 } 396 }
395 397
396 // This test is intended for manual tests and should only be enabled 398 // This test is intended for manual tests and should only be enabled
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 617
616 aos->Start(&source); 618 aos->Start(&source);
617 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), 619 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
618 TestTimeouts::action_timeout()); 620 TestTimeouts::action_timeout());
619 loop.Run(); 621 loop.Run();
620 aos->Stop(); 622 aos->Stop();
621 aos->Close(); 623 aos->Close();
622 } 624 }
623 625
624 } // namespace media 626 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698