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

Unified Diff: media/audio/mac/audio_auhal_mac_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
« no previous file with comments | « media/audio/audio_unittest_util.cc ('k') | media/audio/mac/audio_low_latency_input_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_auhal_mac_unittest.cc
diff --git a/media/audio/mac/audio_auhal_mac_unittest.cc b/media/audio/mac/audio_auhal_mac_unittest.cc
index 4e63e5dffa3030683e2db6b451b368cfb3680571..b9c857d706c89b3cd022c4124af948958624493e 100644
--- a/media/audio/mac/audio_auhal_mac_unittest.cc
+++ b/media/audio/mac/audio_auhal_mac_unittest.cc
@@ -9,6 +9,7 @@
#include "base/synchronization/waitable_event.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_manager.h"
+#include "media/audio/audio_unittest_util.h"
#include "media/audio/mock_audio_source_callback.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,7 +47,7 @@ class AUHALStreamTest : public testing::Test {
manager_->GetDefaultOutputStreamParameters(), "");
}
- bool CanRunAudioTests() {
+ bool OutputDevicesAvailable() {
return manager_->HasAudioOutputDevices();
}
@@ -60,8 +61,7 @@ class AUHALStreamTest : public testing::Test {
};
TEST_F(AUHALStreamTest, HardwareSampleRate) {
- if (!CanRunAudioTests())
- return;
+ ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable());
const AudioParameters preferred_params =
manager_->GetDefaultOutputStreamParameters();
EXPECT_GE(preferred_params.sample_rate(), 16000);
@@ -69,22 +69,19 @@ TEST_F(AUHALStreamTest, HardwareSampleRate) {
}
TEST_F(AUHALStreamTest, CreateClose) {
- if (!CanRunAudioTests())
- return;
+ ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable());
Create()->Close();
}
TEST_F(AUHALStreamTest, CreateOpenClose) {
- if (!CanRunAudioTests())
- return;
+ ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable());
AudioOutputStream* stream = Create();
EXPECT_TRUE(stream->Open());
stream->Close();
}
TEST_F(AUHALStreamTest, CreateOpenStartStopClose) {
- if (!CanRunAudioTests())
- return;
+ ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable());
AudioOutputStream* stream = Create();
EXPECT_TRUE(stream->Open());
« no previous file with comments | « media/audio/audio_unittest_util.cc ('k') | media/audio/mac/audio_low_latency_input_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698