Commit 4a69ba84 authored by tommi@chromium.org's avatar tommi@chromium.org

Allow the AudioLowLatencyInputOutput, WinAudioOutputTest and WinAudioInputTest...

Allow the AudioLowLatencyInputOutput, WinAudioOutputTest and WinAudioInputTest tests to run on bots where audio hardware is available.
The tests will succeed (to avoid breaking the tree) with a warning printed out on bots that don't have the necessary hardware.

TEST=Run media_unittests on the build bots.
Review URL: http://codereview.chromium.org/8949015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114638 0039d316-1c4b-4281-b951-d872f2087c98
parent 961e8971
......@@ -110,11 +110,11 @@ class AudioLowLatencyInputOutputTest : public testing::Test {
// Convenience method which ensures that we are not running on the build
// bots and that at least one valid input and output device can be found.
bool CanRunAudioTests() {
scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasVar("CHROME_HEADLESS"))
return false;
return (audio_manager()->HasAudioInputDevices() &&
audio_manager()->HasAudioOutputDevices());
bool input = audio_manager()->HasAudioInputDevices();
bool output = audio_manager()->HasAudioOutputDevices();
LOG_IF(WARNING, !input) << "No input device detected.";
LOG_IF(WARNING, !output) << "No output device detected.";
return input && output;
}
private:
......
......@@ -89,13 +89,11 @@ class WriteToFileAudioSink : public AudioInputStream::AudioInputCallback {
// Convenience method which ensures that we are not running on the build
// bots and that at least one valid input device can be found.
static bool CanRunAudioTests(AudioManager* audio_man) {
scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasVar("CHROME_HEADLESS"))
return false;
// TODO(henrika): note that we use Wave today to query the number of
// existing input devices.
return audio_man->HasAudioInputDevices();
bool input = audio_man->HasAudioInputDevices();
LOG_IF(WARNING, !input) << "No input device detected.";
return input;
}
// Convenience method which creates a default AudioInputStream object but
......
......@@ -143,15 +143,11 @@ class ReadFromFileAudioSource : public AudioOutputStream::AudioSourceCallback {
// Convenience method which ensures that we are not running on the build
// bots and that at least one valid output device can be found.
static bool CanRunAudioTests(AudioManager* audio_man) {
if (NULL == audio_man)
return false;
scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasVar("CHROME_HEADLESS"))
return false;
// TODO(henrika): note that we use Wave today to query the number of
// existing output devices.
return audio_man->HasAudioOutputDevices();
bool output = audio_man->HasAudioOutputDevices();
LOG_IF(WARNING, !output) << "No output devices detected.";
return output;
}
// Convenience method which creates a default AudioOutputStream object but
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment