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

Unified Diff: content/browser/webrtc/webrtc_content_browsertest_base.cc

Issue 2801983003: Switching WebRTC browser test from AudioManager::HasAudioOutputDevices() to AudioSystem interface. (Closed)
Patch Set: moved HasAudioOutputDevices() to WebRtcContentBrowserTestBase Created 3 years, 8 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 | « content/browser/webrtc/webrtc_content_browsertest_base.h ('k') | media/audio/audio_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/browser/webrtc/webrtc_content_browsertest_base.h ('k') | media/audio/audio_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698