diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-19 23:54:04 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-19 23:54:04 +0000 |
commit | 540ddbbc036e706a3c038418eba364a3422e835b (patch) | |
tree | d30c69c53310b834895efad2295746e5c631ea5d /media | |
parent | b6d568f8ea1369c8d3fb80ed9d20a41ae2419733 (diff) | |
download | chromium_src-540ddbbc036e706a3c038418eba364a3422e835b.zip chromium_src-540ddbbc036e706a3c038418eba364a3422e835b.tar.gz chromium_src-540ddbbc036e706a3c038418eba364a3422e835b.tar.bz2 |
Do not runsome PCM audio tests on the bots
- They are flaky when somebody RDPs into the bots. The system somehow
installs an audio device on the fly that goes bad.
- I think this is the issue as well on the trybots
TBR=nsylvain
Review URL: http://codereview.chromium.org/18197
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/win/audio_output_win_unittest.cc | 24 | ||||
-rw-r--r-- | media/audio/win/waveout_output_win.cc | 4 |
2 files changed, 25 insertions, 3 deletions
diff --git a/media/audio/win/audio_output_win_unittest.cc b/media/audio/win/audio_output_win_unittest.cc index 7635420..25dd7e6 100644 --- a/media/audio/win/audio_output_win_unittest.cc +++ b/media/audio/win/audio_output_win_unittest.cc @@ -10,6 +10,8 @@ #include "media/audio/simple_sources.h" #include "testing/gtest/include/gtest/gtest.h" +namespace { + // This class allows to find out if the callbacks are occurring as // expected and if any error has been reported. class TestSourceBasic : public AudioOutputStream::AudioSourceCallback { @@ -65,6 +67,13 @@ class TestSourceBasic : public AudioOutputStream::AudioSourceCallback { int was_closed_; }; +bool IsRunningHeadless() { + return (0 != ::GetEnvironmentVariableW(L"CHROME_HEADLESS", NULL, 0)); +} + +} // namespace. + + // Specializes TestSourceBasic to detect that the AudioStream is using // double buffering correctly. class TestSourceDoubleBuffer : public TestSourceBasic { @@ -165,9 +174,16 @@ TEST(WinAudioTest, SineWaveAudio16MonoTest) { // =========================================================================== // Validation of AudioManager::AUDIO_PCM_LINEAR +// +// The tests tend to fail in the build bots when somebody connects to them via +// via remote-desktop because it installs an audio device that fails to open +// at some point, possibly when the connection goes idle. So that is why we +// skipped them in headless mode. // Test that can it be created and closed. TEST(WinAudioTest, PCMWaveStreamGetAndClose) { + if (IsRunningHeadless()) + return; AudioManager* audio_man = AudioManager::GetAudioManager(); ASSERT_TRUE(NULL != audio_man); if (!audio_man->HasAudioDevices()) @@ -180,6 +196,8 @@ TEST(WinAudioTest, PCMWaveStreamGetAndClose) { // Test that it can be opened and closed. TEST(WinAudioTest, PCMWaveStreamOpenAndClose) { + if (IsRunningHeadless()) + return; AudioManager* audio_man = AudioManager::GetAudioManager(); ASSERT_TRUE(NULL != audio_man); if (!audio_man->HasAudioDevices()) @@ -194,6 +212,8 @@ TEST(WinAudioTest, PCMWaveStreamOpenAndClose) { // Test that it uses the double buffers correctly. Because it uses the actual // audio device, you might hear a short pop noise for a short time. TEST(WinAudioTest, PCMWaveStreamDoubleBuffer) { + if (IsRunningHeadless()) + return; AudioManager* audio_man = AudioManager::GetAudioManager(); ASSERT_TRUE(NULL != audio_man); if (!audio_man->HasAudioDevices()) @@ -216,6 +236,8 @@ TEST(WinAudioTest, PCMWaveStreamDoubleBuffer) { // device at 44.1K s/sec. Parameters have been chosen carefully so you should // not hear pops or noises while the sound is playing. TEST(WinAudioTest, PCMWaveStreamPlay200HzTone44Kss) { + if (IsRunningHeadless()) + return; AudioManager* audio_man = AudioManager::GetAudioManager(); ASSERT_TRUE(NULL != audio_man); if (!audio_man->HasAudioDevices()) @@ -240,6 +262,8 @@ TEST(WinAudioTest, PCMWaveStreamPlay200HzTone44Kss) { // device at 22K s/sec. Parameters have been chosen carefully so you should // not hear pops or noises while the sound is playing. TEST(WinAudioTest, PCMWaveStreamPlay200HzTone22Kss) { + if (IsRunningHeadless()) + return; AudioManager* audio_man = AudioManager::GetAudioManager(); ASSERT_TRUE(NULL != audio_man); if (!audio_man->HasAudioDevices()) diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc index dbacad0..fa84884 100644 --- a/media/audio/win/waveout_output_win.cc +++ b/media/audio/win/waveout_output_win.cc @@ -77,10 +77,8 @@ bool PCMWaveOutAudioOutputStream::Open(size_t buffer_size) { reinterpret_cast<DWORD_PTR>(WaveCallback), reinterpret_cast<DWORD_PTR>(this), CALLBACK_FUNCTION); - if (result != MMSYSERR_NOERROR) { - fprintf(stderr, "waveOutOpen error %d\n", result); + if (result != MMSYSERR_NOERROR) return false; - } // If we don't have a packet size we use 100ms. if (!buffer_size) buffer_size = format_.nAvgBytesPerSec / 10; |