OLD | NEW |
---|---|
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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. |
384 EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet))) | 384 EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet))) |
385 .WillOnce(DoAll(QuitLoop(loop.task_runner()), | 385 .WillRepeatedly(DoAll(QuitLoop(loop.task_runner()), |
tommi (sloooow) - chröme
2015/12/01 10:06:54
nit: You could do |WillOnce(<QuitLoop>).WillRepeat
wdzierzanowski
2015/12/01 16:42:40
Done.
| |
386 Return(aosw.samples_per_packet()))); | 386 Return(aosw.samples_per_packet()))); |
387 | 387 |
388 aos->Start(&source); | 388 aos->Start(&source); |
389 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), | 389 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
390 TestTimeouts::action_timeout()); | 390 TestTimeouts::action_timeout()); |
391 loop.Run(); | 391 loop.Run(); |
392 aos->Stop(); | 392 aos->Stop(); |
393 aos->Close(); | 393 aos->Close(); |
394 } | 394 } |
395 | 395 |
396 // This test is intended for manual tests and should only be enabled | 396 // This test is intended for manual tests and should only be enabled |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 | 615 |
616 aos->Start(&source); | 616 aos->Start(&source); |
617 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), | 617 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
618 TestTimeouts::action_timeout()); | 618 TestTimeouts::action_timeout()); |
619 loop.Run(); | 619 loop.Run(); |
620 aos->Stop(); | 620 aos->Stop(); |
621 aos->Close(); | 621 aos->Close(); |
622 } | 622 } |
623 | 623 |
624 } // namespace media | 624 } // namespace media |
OLD | NEW |