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

Unified Diff: media/audio/audio_input_volume_unittest.cc

Issue 914483002: Add flag --require-audio-hardware-for-testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_input_volume_unittest.cc
diff --git a/media/audio/audio_input_volume_unittest.cc b/media/audio/audio_input_volume_unittest.cc
index a2213a3e92be7306f5d76a4c1aebdceb397f15ac..9327b220a82871676f2f4e964f4c777b9bf9e720 100644
--- a/media/audio/audio_input_volume_unittest.cc
+++ b/media/audio/audio_input_volume_unittest.cc
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_manager_base.h"
+#include "media/audio/audio_unittest_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN)
@@ -45,17 +46,12 @@ class AudioInputVolumeTest : public ::testing::Test {
{
}
- bool CanRunAudioTests() {
+ bool HasCoreAudioAndInputDevices() {
#if defined(OS_WIN)
// TODO(henrika): add support for volume control on Windows XP as well.
- // For now, we might as well signal false already here to avoid running
- // these tests on Windows XP.
- if (!CoreAudioUtil::IsSupported())
+ if (!CoreAudioUtils::IsSupported())
return false;
#endif
- if (!audio_manager_)
- return false;
-
return audio_manager_->HasAudioInputDevices();
}
@@ -106,8 +102,7 @@ class AudioInputVolumeTest : public ::testing::Test {
#endif
TEST_F(AudioInputVolumeTest, MAYBE_InputVolumeTest) {
- if (!CanRunAudioTests())
- return;
+ ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices());
// Retrieve a list of all available input devices.
AudioDeviceNames device_names;

Powered by Google App Engine
This is Rietveld 408576698