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

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: 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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