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

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

Issue 155863003: Add basic support for "googDucking" to getUserMedia on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Initialize enumeration flag in constructor Created 6 years, 10 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
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/file_util.h" 10 #include "base/file_util.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 Return(aosw.samples_per_packet()))); 416 Return(aosw.samples_per_packet())));
417 417
418 aos->Start(&source); 418 aos->Start(&source);
419 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), 419 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
420 TestTimeouts::action_timeout()); 420 TestTimeouts::action_timeout());
421 loop.Run(); 421 loop.Run();
422 aos->Stop(); 422 aos->Stop();
423 aos->Close(); 423 aos->Close();
424 } 424 }
425 425
426 // Use a non-preferred packet size and verify that Open() fails.
427 TEST(WASAPIAudioOutputStreamTest, InvalidPacketSize) {
428 scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
429 if (!CanRunAudioTests(audio_manager.get()))
430 return;
431
432 if (ExclusiveModeIsEnabled())
433 return;
434
435 AudioParameters preferred_params;
436 EXPECT_TRUE(SUCCEEDED(CoreAudioUtil::GetPreferredAudioParameters(
437 eRender, eConsole, &preferred_params)));
438 int too_large_packet_size = 2 * preferred_params.frames_per_buffer();
439
440 AudioOutputStreamWrapper aosw(audio_manager.get());
441 AudioOutputStream* aos = aosw.Create(too_large_packet_size);
442 EXPECT_FALSE(aos->Open());
443
444 aos->Close();
445 }
446
447 // This test is intended for manual tests and should only be enabled 426 // This test is intended for manual tests and should only be enabled
448 // when it is required to play out data from a local PCM file. 427 // when it is required to play out data from a local PCM file.
449 // By default, GTest will print out YOU HAVE 1 DISABLED TEST. 428 // By default, GTest will print out YOU HAVE 1 DISABLED TEST.
450 // To include disabled tests in test execution, just invoke the test program 429 // To include disabled tests in test execution, just invoke the test program
451 // with --gtest_also_run_disabled_tests or set the GTEST_ALSO_RUN_DISABLED_TESTS 430 // with --gtest_also_run_disabled_tests or set the GTEST_ALSO_RUN_DISABLED_TESTS
452 // environment variable to a value greater than 0. 431 // environment variable to a value greater than 0.
453 // The test files are approximately 20 seconds long. 432 // The test files are approximately 20 seconds long.
454 TEST(WASAPIAudioOutputStreamTest, DISABLED_ReadFromStereoFile) { 433 TEST(WASAPIAudioOutputStreamTest, DISABLED_ReadFromStereoFile) {
455 scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting()); 434 scoped_ptr<AudioManager> audio_manager(AudioManager::CreateForTesting());
456 if (!CanRunAudioTests(audio_manager.get())) 435 if (!CanRunAudioTests(audio_manager.get()))
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 663
685 aos->Start(&source); 664 aos->Start(&source);
686 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), 665 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
687 TestTimeouts::action_timeout()); 666 TestTimeouts::action_timeout());
688 loop.Run(); 667 loop.Run();
689 aos->Stop(); 668 aos->Stop();
690 aos->Close(); 669 aos->Close();
691 } 670 }
692 671
693 } // namespace media 672 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/audio/win/audio_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698