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

Side by Side Diff: content/browser/webrtc/webrtc_audio_browsertest.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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/browser/webrtc/webrtc_content_browsertest_base.h" 10 #include "content/browser/webrtc/webrtc_content_browsertest_base.h"
11 #include "content/public/common/content_switches.h" 11 #include "content/public/common/content_switches.h"
12 #include "content/public/common/webrtc_ip_handling_policy.h" 12 #include "content/public/common/webrtc_ip_handling_policy.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/public/test/test_utils.h" 15 #include "content/public/test/test_utils.h"
16 #include "media/audio/audio_manager.h"
17 #include "media/base/media_switches.h" 16 #include "media/base/media_switches.h"
18 #include "net/test/embedded_test_server/embedded_test_server.h" 17 #include "net/test/embedded_test_server/embedded_test_server.h"
19 18
20 namespace content { 19 namespace content {
21 20
22 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER) 21 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
23 // Renderer crashes under Android ASAN: https://crbug.com/408496. 22 // Renderer crashes under Android ASAN: https://crbug.com/408496.
24 #define MAYBE_WebRtcAudioBrowserTest DISABLED_WebRtcAudioBrowserTest 23 #define MAYBE_WebRtcAudioBrowserTest DISABLED_WebRtcAudioBrowserTest
25 #else 24 #else
26 #define MAYBE_WebRtcAudioBrowserTest WebRtcAudioBrowserTest 25 #define MAYBE_WebRtcAudioBrowserTest WebRtcAudioBrowserTest
(...skipping 10 matching lines...) Expand all
37 WebRtcContentBrowserTestBase::SetUpCommandLine(command_line); 36 WebRtcContentBrowserTestBase::SetUpCommandLine(command_line);
38 // Automatically grant device permission. 37 // Automatically grant device permission.
39 AppendUseFakeUIForMediaStreamFlag(); 38 AppendUseFakeUIForMediaStreamFlag();
40 } 39 }
41 40
42 protected: 41 protected:
43 // Convenience method for making calls that detect if audio os playing (which 42 // Convenience method for making calls that detect if audio os playing (which
44 // has some special prerequisites, such that there needs to be an audio output 43 // has some special prerequisites, such that there needs to be an audio output
45 // device on the executing machine). 44 // device on the executing machine).
46 void MakeAudioDetectingPeerConnectionCall(const std::string& javascript) { 45 void MakeAudioDetectingPeerConnectionCall(const std::string& javascript) {
47 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { 46 if (!HasAudioOutputDevices()) {
48 // Bots with no output devices will force the audio code into a state 47 // Bots with no output devices will force the audio code into a state
49 // where it doesn't manage to set either the low or high latency path. 48 // where it doesn't manage to set either the low or high latency path.
50 // This test will compute useless values in that case, so skip running on 49 // This test will compute useless values in that case, so skip running on
51 // such bots (see crbug.com/326338). 50 // such bots (see crbug.com/326338).
52 LOG(INFO) << "Missing output devices: skipping test..."; 51 LOG(INFO) << "Missing output devices: skipping test...";
53 return; 52 return;
54 } 53 }
55 54
56 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( 55 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch(
57 switches::kUseFakeDeviceForMediaStream)) 56 switches::kUseFakeDeviceForMediaStream))
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 "callAndEnsureRemoteVideoMutingDoesntMuteAudio();"); 109 "callAndEnsureRemoteVideoMutingDoesntMuteAudio();");
111 } 110 }
112 111
113 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioBrowserTest, 112 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioBrowserTest,
114 EstablishAudioVideoCallAndVerifyUnmutingWorks) { 113 EstablishAudioVideoCallAndVerifyUnmutingWorks) {
115 MakeAudioDetectingPeerConnectionCall( 114 MakeAudioDetectingPeerConnectionCall(
116 "callAndEnsureAudioTrackUnmutingWorks();"); 115 "callAndEnsureAudioTrackUnmutingWorks();");
117 } 116 }
118 117
119 } // namespace content 118 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698