Index: content/browser/webrtc/webrtc_content_browsertest_base.cc |
diff --git a/content/browser/webrtc/webrtc_content_browsertest_base.cc b/content/browser/webrtc/webrtc_content_browsertest_base.cc |
index e9cc627b59f8bef7395adb6b81952b527ccb6b92..91a8a77e89c0b84b9aa805fb8dd4562f4e403d08 100644 |
--- a/content/browser/webrtc/webrtc_content_browsertest_base.cc |
+++ b/content/browser/webrtc/webrtc_content_browsertest_base.cc |
@@ -13,6 +13,7 @@ |
#include "content/public/test/browser_test_utils.h" |
#include "content/public/test/content_browser_test_utils.h" |
#include "content/shell/browser/shell.h" |
+#include "media/audio/audio_system.h" |
#include "media/base/media_switches.h" |
#include "net/test/embedded_test_server/embedded_test_server.h" |
@@ -107,4 +108,18 @@ void WebRtcContentBrowserTestBase::ExecuteJavascriptAndWaitForOk( |
min_frame_rate, max_frame_rate); |
} |
+// static |
+bool WebRtcContentBrowserTestBase::HasAudioOutputDevices() { |
+ bool has_devices = false; |
+ base::RunLoop run_loop; |
+ media::AudioSystem::Get()->HasOutputDevices(base::Bind( |
+ [](base::Closure finished_callback, bool* result, bool received) { |
+ *result = received; |
+ finished_callback.Run(); |
+ }, |
+ base::Passed(run_loop.QuitClosure()), &has_devices)); |
+ run_loop.Run(); |
+ return has_devices; |
+} |
+ |
} // namespace content |