OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/webrtc/webrtc_content_browsertest_base.h" | 5 #include "content/browser/webrtc/webrtc_content_browsertest_base.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
14 #include "content/public/test/content_browser_test_utils.h" | 14 #include "content/public/test/content_browser_test_utils.h" |
15 #include "content/shell/browser/shell.h" | 15 #include "content/shell/browser/shell.h" |
| 16 #include "media/audio/audio_system.h" |
16 #include "media/base/media_switches.h" | 17 #include "media/base/media_switches.h" |
17 #include "net/test/embedded_test_server/embedded_test_server.h" | 18 #include "net/test/embedded_test_server/embedded_test_server.h" |
18 | 19 |
19 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
20 #include "chromeos/audio/cras_audio_handler.h" | 21 #include "chromeos/audio/cras_audio_handler.h" |
21 #endif | 22 #endif |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 void WebRtcContentBrowserTestBase::SetUpCommandLine( | 26 void WebRtcContentBrowserTestBase::SetUpCommandLine( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int min_frame_rate, | 101 int min_frame_rate, |
101 int max_frame_rate) const { | 102 int max_frame_rate) const { |
102 return base::StringPrintf( | 103 return base::StringPrintf( |
103 "%s({video: {mandatory: {minWidth: %d, maxWidth: %d, " | 104 "%s({video: {mandatory: {minWidth: %d, maxWidth: %d, " |
104 "minHeight: %d, maxHeight: %d, minFrameRate: %d, maxFrameRate: %d}, " | 105 "minHeight: %d, maxHeight: %d, minFrameRate: %d, maxFrameRate: %d}, " |
105 "optional: []}});", | 106 "optional: []}});", |
106 function_name, min_width, max_width, min_height, max_height, | 107 function_name, min_width, max_width, min_height, max_height, |
107 min_frame_rate, max_frame_rate); | 108 min_frame_rate, max_frame_rate); |
108 } | 109 } |
109 | 110 |
| 111 // static |
| 112 bool WebRtcContentBrowserTestBase::HasAudioOutputDevices() { |
| 113 bool has_devices = false; |
| 114 base::RunLoop run_loop; |
| 115 media::AudioSystem::Get()->HasOutputDevices(base::Bind( |
| 116 [](base::Closure finished_callback, bool* result, bool received) { |
| 117 *result = received; |
| 118 finished_callback.Run(); |
| 119 }, |
| 120 base::Passed(run_loop.QuitClosure()), &has_devices)); |
| 121 run_loop.Run(); |
| 122 return has_devices; |
| 123 } |
| 124 |
110 } // namespace content | 125 } // namespace content |
OLD | NEW |