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

Side by Side Diff: content/browser/media/webrtc_browsertest.cc

Issue 194713010: duplicate the webrtc content_browser tests and browser tests with --enable-audio-track-processing on (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed the comments. Created 6 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "content/browser/media/webrtc_internals.h" 8 #include "content/browser/media/webrtc_internals.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
11 #include "content/public/test/browser_test_utils.h" 11 #include "content/public/test/browser_test_utils.h"
12 #include "content/public/test/test_utils.h" 12 #include "content/public/test/test_utils.h"
13 #include "content/shell/browser/shell.h" 13 #include "content/shell/browser/shell.h"
14 #include "content/test/content_browser_test_utils.h" 14 #include "content/test/content_browser_test_utils.h"
15 #include "content/test/webrtc_content_browsertest_base.h" 15 #include "content/test/webrtc_content_browsertest_base.h"
16 #include "media/audio/audio_manager.h" 16 #include "media/audio/audio_manager.h"
17 #include "net/test/embedded_test_server/embedded_test_server.h" 17 #include "net/test/embedded_test_server/embedded_test_server.h"
18 18
19 #if defined(OS_WIN) 19 #if defined(OS_WIN)
20 #include "base/win/windows_version.h" 20 #include "base/win/windows_version.h"
21 #endif 21 #endif
22 22
23 namespace content { 23 namespace content {
24 24
25 class WebRtcBrowserTest : public WebRtcContentBrowserTest { 25 class WebRtcBrowserTest : public WebRtcContentBrowserTest,
26 public testing::WithParamInterface<bool> {
26 public: 27 public:
27 WebRtcBrowserTest() {} 28 WebRtcBrowserTest() {
29 bool enable_audio_track_processing = GetParam();
30 if (enable_audio_track_processing) {
31 CommandLine::ForCurrentProcess()->AppendSwitch(
32 switches::kEnableAudioTrackProcessing);
phoglund_chromium 2014/03/13 09:04:49 Do this in SetUpCommandLine instead. It's overridd
no longer working on chromium 2014/03/13 09:58:08 Done.
33 }
34 }
28 virtual ~WebRtcBrowserTest() {} 35 virtual ~WebRtcBrowserTest() {}
29 36
30 // Convenience function since most peerconnection-call.html tests just load 37 // Convenience function since most peerconnection-call.html tests just load
31 // the page, kick off some javascript and wait for the title to change to OK. 38 // the page, kick off some javascript and wait for the title to change to OK.
32 void MakeTypicalPeerConnectionCall(const std::string& javascript) { 39 void MakeTypicalPeerConnectionCall(const std::string& javascript) {
33 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 40 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
34 41
35 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 42 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
36 NavigateToURL(shell(), url); 43 NavigateToURL(shell(), url);
37 44
38 DisableOpusIfOnAndroid(); 45 DisableOpusIfOnAndroid();
39 ExecuteJavascriptAndWaitForOk(javascript); 46 ExecuteJavascriptAndWaitForOk(javascript);
40 } 47 }
41 48
42 void DisableOpusIfOnAndroid() { 49 void DisableOpusIfOnAndroid() {
43 #if defined (OS_ANDROID) 50 #if defined (OS_ANDROID)
44 // Always force iSAC 16K on Android for now (Opus is broken). 51 // Always force iSAC 16K on Android for now (Opus is broken).
45 EXPECT_EQ("isac-forced", 52 EXPECT_EQ("isac-forced",
46 ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();")); 53 ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();"));
47 #endif 54 #endif
48 } 55 }
49 }; 56 };
50 57
58 static const bool kRunTestsWithFlag[] = { false, true };
59 INSTANTIATE_TEST_CASE_P(WebRtcBrowserTests,
60 WebRtcBrowserTest,
61 testing::ValuesIn(kRunTestsWithFlag));
62
51 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 63 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
52 // Timing out on ARM linux bot: http://crbug.com/238490 64 // Timing out on ARM linux bot: http://crbug.com/238490
53 #define MAYBE_CanSetupVideoCall DISABLED_CanSetupVideoCall 65 #define MAYBE_CanSetupVideoCall DISABLED_CanSetupVideoCall
54 #else 66 #else
55 #define MAYBE_CanSetupVideoCall CanSetupVideoCall 67 #define MAYBE_CanSetupVideoCall CanSetupVideoCall
56 #endif 68 #endif
57 69
58 // These tests will make a complete PeerConnection-based call and verify that 70 // These tests will make a complete PeerConnection-based call and verify that
59 // video is playing for the call. 71 // video is playing for the call.
60 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupVideoCall) { 72 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanSetupVideoCall) {
61 MakeTypicalPeerConnectionCall("call({video: true});"); 73 MakeTypicalPeerConnectionCall("call({video: true});");
62 } 74 }
63 75
64 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 76 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
65 // Timing out on ARM linux, see http://crbug.com/240376 77 // Timing out on ARM linux, see http://crbug.com/240376
66 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall 78 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall
67 #else 79 #else
68 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall 80 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall
69 #endif 81 #endif
70 82
71 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) { 83 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) {
72 MakeTypicalPeerConnectionCall("call({video: true, audio: true});"); 84 MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
73 } 85 }
74 86
75 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) { 87 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) {
76 MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,abc\');"); 88 MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,abc\');");
77 } 89 }
78 90
79 // TODO(phoglund): this test fails because the peer connection state will be 91 // TODO(phoglund): this test fails because the peer connection state will be
80 // stable in the second negotiation round rather than have-local-offer. 92 // stable in the second negotiation round rather than have-local-offer.
81 // http://crbug.com/293125. 93 // http://crbug.com/293125.
82 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 94 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
83 DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) { 95 DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) {
84 const char* kJavascript = 96 const char* kJavascript =
85 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});"; 97 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});";
86 MakeTypicalPeerConnectionCall(kJavascript); 98 MakeTypicalPeerConnectionCall(kJavascript);
87 } 99 }
88 100
89 // Below 2 test will make a complete PeerConnection-based call between pc1 and 101 // Below 2 test will make a complete PeerConnection-based call between pc1 and
90 // pc2, and then use the remote stream to setup a call between pc3 and pc4, and 102 // pc2, and then use the remote stream to setup a call between pc3 and pc4, and
91 // then verify that video is received on pc3 and pc4. 103 // then verify that video is received on pc3 and pc4.
92 // Flaky on win xp. http://crbug.com/304775 104 // Flaky on win xp. http://crbug.com/304775
93 #if defined(OS_WIN) 105 #if defined(OS_WIN)
94 #define MAYBE_CanForwardRemoteStream DISABLED_CanForwardRemoteStream 106 #define MAYBE_CanForwardRemoteStream DISABLED_CanForwardRemoteStream
95 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p 107 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p
96 #else 108 #else
97 #define MAYBE_CanForwardRemoteStream CanForwardRemoteStream 109 #define MAYBE_CanForwardRemoteStream CanForwardRemoteStream
98 #define MAYBE_CanForwardRemoteStream720p CanForwardRemoteStream720p 110 #define MAYBE_CanForwardRemoteStream720p CanForwardRemoteStream720p
99 #endif 111 #endif
100 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) { 112 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) {
101 MakeTypicalPeerConnectionCall( 113 MakeTypicalPeerConnectionCall(
102 "callAndForwardRemoteStream({video: true, audio: false});"); 114 "callAndForwardRemoteStream({video: true, audio: false});");
103 } 115 }
104 116
105 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) { 117 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) {
106 const std::string javascript = GenerateGetUserMediaCall( 118 const std::string javascript = GenerateGetUserMediaCall(
107 "callAndForwardRemoteStream", 1280, 1280, 720, 720, 30, 30); 119 "callAndForwardRemoteStream", 1280, 1280, 720, 720, 30, 30);
108 MakeTypicalPeerConnectionCall(javascript); 120 MakeTypicalPeerConnectionCall(javascript);
109 } 121 }
110 122
111 // This test will make a complete PeerConnection-based call but remove the 123 // This test will make a complete PeerConnection-based call but remove the
112 // MSID and bundle attribute from the initial offer to verify that 124 // MSID and bundle attribute from the initial offer to verify that
113 // video is playing for the call even if the initiating client don't support 125 // video is playing for the call even if the initiating client don't support
114 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02 126 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02
115 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 127 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
116 // Timing out on ARM linux, see http://crbug.com/240373 128 // Timing out on ARM linux, see http://crbug.com/240373
117 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ 129 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\
118 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle 130 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle
119 #else 131 #else
120 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ 132 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\
121 CanSetupAudioAndVideoCallWithoutMsidAndBundle 133 CanSetupAudioAndVideoCallWithoutMsidAndBundle
122 #endif 134 #endif
123 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 135 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
124 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) { 136 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
125 MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();"); 137 MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();");
126 } 138 }
127 139
128 // This test will modify the SDP offer to an unsupported codec, which should 140 // This test will modify the SDP offer to an unsupported codec, which should
129 // cause SetLocalDescription to fail. 141 // cause SetLocalDescription to fail.
130 #if defined(USE_OZONE) 142 #if defined(USE_OZONE)
131 // Disabled for Ozone, see http://crbug.com/315392#c15 143 // Disabled for Ozone, see http://crbug.com/315392#c15
132 #define MAYBE_NegotiateUnsupportedVideoCodec\ 144 #define MAYBE_NegotiateUnsupportedVideoCodec\
133 DISABLED_NegotiateUnsupportedVideoCodec 145 DISABLED_NegotiateUnsupportedVideoCodec
134 #else 146 #else
135 #define MAYBE_NegotiateUnsupportedVideoCodec NegotiateUnsupportedVideoCodec 147 #define MAYBE_NegotiateUnsupportedVideoCodec NegotiateUnsupportedVideoCodec
136 #endif 148 #endif
137 149
138 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 150 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
139 MAYBE_NegotiateUnsupportedVideoCodec) { 151 MAYBE_NegotiateUnsupportedVideoCodec) {
140 MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();"); 152 MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();");
141 } 153 }
142 154
143 // This test will modify the SDP offer to use no encryption, which should 155 // This test will modify the SDP offer to use no encryption, which should
144 // cause SetLocalDescription to fail. 156 // cause SetLocalDescription to fail.
145 #if defined(USE_OZONE) 157 #if defined(USE_OZONE)
146 // Disabled for Ozone, see http://crbug.com/315392#c15 158 // Disabled for Ozone, see http://crbug.com/315392#c15
147 #define MAYBE_NegotiateNonCryptoCall DISABLED_NegotiateNonCryptoCall 159 #define MAYBE_NegotiateNonCryptoCall DISABLED_NegotiateNonCryptoCall
148 #else 160 #else
149 #define MAYBE_NegotiateNonCryptoCall NegotiateNonCryptoCall 161 #define MAYBE_NegotiateNonCryptoCall NegotiateNonCryptoCall
150 #endif 162 #endif
151 163
152 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_NegotiateNonCryptoCall) { 164 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_NegotiateNonCryptoCall) {
153 MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();"); 165 MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();");
154 } 166 }
155 167
156 // This test can negotiate an SDP offer that includes a b=AS:xx to control 168 // This test can negotiate an SDP offer that includes a b=AS:xx to control
157 // the bandwidth for audio and video 169 // the bandwidth for audio and video
158 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateOfferWithBLine) { 170 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, NegotiateOfferWithBLine) {
159 MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();"); 171 MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();");
160 } 172 }
161 173
162 // This test will make a complete PeerConnection-based call using legacy SDP 174 // This test will make a complete PeerConnection-based call using legacy SDP
163 // settings: GIce, external SDES, and no BUNDLE. 175 // settings: GIce, external SDES, and no BUNDLE.
164 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 176 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
165 // Timing out on ARM linux, see http://crbug.com/240373 177 // Timing out on ARM linux, see http://crbug.com/240373
166 #define MAYBE_CanSetupLegacyCall DISABLED_CanSetupLegacyCall 178 #define MAYBE_CanSetupLegacyCall DISABLED_CanSetupLegacyCall
167 #else 179 #else
168 #define MAYBE_CanSetupLegacyCall CanSetupLegacyCall 180 #define MAYBE_CanSetupLegacyCall CanSetupLegacyCall
169 #endif 181 #endif
170 182
171 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) { 183 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) {
172 MakeTypicalPeerConnectionCall("callWithLegacySdp();"); 184 MakeTypicalPeerConnectionCall("callWithLegacySdp();");
173 } 185 }
174 186
175 // This test will make a PeerConnection-based call and test an unreliable text 187 // This test will make a PeerConnection-based call and test an unreliable text
176 // dataChannel. 188 // dataChannel.
177 // TODO(mallinath) - Remove this test after rtp based data channel is disabled. 189 // TODO(mallinath) - Remove this test after rtp based data channel is disabled.
178 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallWithDataOnly) { 190 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, CallWithDataOnly) {
179 MakeTypicalPeerConnectionCall("callWithDataOnly();"); 191 MakeTypicalPeerConnectionCall("callWithDataOnly();");
180 } 192 }
181 193
182 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallWithSctpDataOnly) { 194 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, CallWithSctpDataOnly) {
183 MakeTypicalPeerConnectionCall("callWithSctpDataOnly();"); 195 MakeTypicalPeerConnectionCall("callWithSctpDataOnly();");
184 } 196 }
185 197
186 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 198 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
187 // Timing out on ARM linux bot: http://crbug.com/238490 199 // Timing out on ARM linux bot: http://crbug.com/238490
188 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia 200 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia
189 #else 201 #else
190 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia 202 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia
191 #endif 203 #endif
192 204
193 // This test will make a PeerConnection-based call and test an unreliable text 205 // This test will make a PeerConnection-based call and test an unreliable text
194 // dataChannel and audio and video tracks. 206 // dataChannel and audio and video tracks.
195 // TODO(mallinath) - Remove this test after rtp based data channel is disabled. 207 // TODO(mallinath) - Remove this test after rtp based data channel is disabled.
196 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithDataAndMedia) { 208 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CallWithDataAndMedia) {
197 MakeTypicalPeerConnectionCall("callWithDataAndMedia();"); 209 MakeTypicalPeerConnectionCall("callWithDataAndMedia();");
198 } 210 }
199 211
200 212
201 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 213 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
202 // Timing out on ARM linux bot: http://crbug.com/238490 214 // Timing out on ARM linux bot: http://crbug.com/238490
203 #define MAYBE_CallWithSctpDataAndMedia DISABLED_CallWithSctpDataAndMedia 215 #define MAYBE_CallWithSctpDataAndMedia DISABLED_CallWithSctpDataAndMedia
204 #else 216 #else
205 #define MAYBE_CallWithSctpDataAndMedia CallWithSctpDataAndMedia 217 #define MAYBE_CallWithSctpDataAndMedia CallWithSctpDataAndMedia
206 #endif 218 #endif
207 219
208 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 220 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
209 MAYBE_CallWithSctpDataAndMedia) { 221 MAYBE_CallWithSctpDataAndMedia) {
210 MakeTypicalPeerConnectionCall("callWithSctpDataAndMedia();"); 222 MakeTypicalPeerConnectionCall("callWithSctpDataAndMedia();");
211 } 223 }
212 224
213 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 225 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
214 // Timing out on ARM linux bot: http://crbug.com/238490 226 // Timing out on ARM linux bot: http://crbug.com/238490
215 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia 227 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia
216 #else 228 #else
217 // Temporarily disable the test on all platforms. http://crbug.com/293252 229 // Temporarily disable the test on all platforms. http://crbug.com/293252
218 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia 230 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia
219 #endif 231 #endif
220 232
221 // This test will make a PeerConnection-based call and test an unreliable text 233 // This test will make a PeerConnection-based call and test an unreliable text
222 // dataChannel and later add an audio and video track. 234 // dataChannel and later add an audio and video track.
223 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) { 235 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) {
224 MakeTypicalPeerConnectionCall("callWithDataAndLaterAddMedia();"); 236 MakeTypicalPeerConnectionCall("callWithDataAndLaterAddMedia();");
225 } 237 }
226 238
227 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 239 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
228 // Timing out on ARM linux bot: http://crbug.com/238490 240 // Timing out on ARM linux bot: http://crbug.com/238490
229 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream 241 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream
230 #else 242 #else
231 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream 243 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream
232 #endif 244 #endif
233 245
234 // This test will make a PeerConnection-based call and send a new Video 246 // This test will make a PeerConnection-based call and send a new Video
235 // MediaStream that has been created based on a MediaStream created with 247 // MediaStream that has been created based on a MediaStream created with
236 // getUserMedia. 248 // getUserMedia.
237 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) { 249 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) {
238 MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();"); 250 MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();");
239 } 251 }
240 252
241 // This test will make a PeerConnection-based call and send a new Video 253 // This test will make a PeerConnection-based call and send a new Video
242 // MediaStream that has been created based on a MediaStream created with 254 // MediaStream that has been created based on a MediaStream created with
243 // getUserMedia. When video is flowing, the VideoTrack is removed and an 255 // getUserMedia. When video is flowing, the VideoTrack is removed and an
244 // AudioTrack is added instead. 256 // AudioTrack is added instead.
245 // TODO(phoglund): This test is manual since not all buildbots has an audio 257 // TODO(phoglund): This test is manual since not all buildbots has an audio
246 // input. 258 // input.
247 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CallAndModifyStream) { 259 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_CallAndModifyStream) {
248 MakeTypicalPeerConnectionCall( 260 MakeTypicalPeerConnectionCall(
249 "callWithNewVideoMediaStreamLaterSwitchToAudio();"); 261 "callWithNewVideoMediaStreamLaterSwitchToAudio();");
250 } 262 }
251 263
252 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) { 264 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) {
253 MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();"); 265 MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();");
254 } 266 }
255 267
256 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 268 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
257 EstablishAudioVideoCallAndMeasureOutputLevel) { 269 EstablishAudioVideoCallAndMeasureOutputLevel) {
258 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { 270 if (!media::AudioManager::Get()->HasAudioOutputDevices()) {
259 // Bots with no output devices will force the audio code into a different 271 // Bots with no output devices will force the audio code into a different
260 // path where it doesn't manage to set either the low or high latency path. 272 // path where it doesn't manage to set either the low or high latency path.
261 // This test will compute useless values in that case, so skip running on 273 // This test will compute useless values in that case, so skip running on
262 // such bots (see crbug.com/326338). 274 // such bots (see crbug.com/326338).
263 LOG(INFO) << "Missing output devices: skipping test..."; 275 LOG(INFO) << "Missing output devices: skipping test...";
264 return; 276 return;
265 } 277 }
266 278
267 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( 279 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch(
268 switches::kUseFakeDeviceForMediaStream)) 280 switches::kUseFakeDeviceForMediaStream))
269 << "Must run with fake devices since the test will explicitly look " 281 << "Must run with fake devices since the test will explicitly look "
270 << "for the fake device signal."; 282 << "for the fake device signal.";
271 283
272 MakeTypicalPeerConnectionCall("callAndEnsureAudioIsPlaying();"); 284 MakeTypicalPeerConnectionCall("callAndEnsureAudioIsPlaying();");
273 } 285 }
274 286
275 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 287 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
276 EstablishAudioVideoCallAndVerifyMutingWorks) { 288 EstablishAudioVideoCallAndVerifyMutingWorks) {
277 if (!media::AudioManager::Get()->HasAudioOutputDevices()) { 289 if (!media::AudioManager::Get()->HasAudioOutputDevices()) {
278 // Bots with no output devices will force the audio code into a different 290 // Bots with no output devices will force the audio code into a different
279 // path where it doesn't manage to set either the low or high latency path. 291 // path where it doesn't manage to set either the low or high latency path.
280 // This test will compute useless values in that case, so skip running on 292 // This test will compute useless values in that case, so skip running on
281 // such bots (see crbug.com/326338). 293 // such bots (see crbug.com/326338).
282 LOG(INFO) << "Missing output devices: skipping test..."; 294 LOG(INFO) << "Missing output devices: skipping test...";
283 return; 295 return;
284 } 296 }
285 297
286 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( 298 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch(
287 switches::kUseFakeDeviceForMediaStream)) 299 switches::kUseFakeDeviceForMediaStream))
288 << "Must run with fake devices since the test will explicitly look " 300 << "Must run with fake devices since the test will explicitly look "
289 << "for the fake device signal."; 301 << "for the fake device signal.";
290 302
291 MakeTypicalPeerConnectionCall("callAndEnsureAudioMutingWorks();"); 303 MakeTypicalPeerConnectionCall("callAndEnsureAudioMutingWorks();");
292 } 304 }
293 305
294 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) { 306 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) {
295 MakeTypicalPeerConnectionCall("callAndEnsureVideoMutingWorks();"); 307 MakeTypicalPeerConnectionCall("callAndEnsureVideoMutingWorks();");
296 } 308 }
297 309
298 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 310 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
299 // Timing out on ARM linux bot: http://crbug.com/238490 311 // Timing out on ARM linux bot: http://crbug.com/238490
300 #define MAYBE_CallWithAecDump DISABLED_CallWithAecDump 312 #define MAYBE_CallWithAecDump DISABLED_CallWithAecDump
301 #else 313 #else
302 #define MAYBE_CallWithAecDump CallWithAecDump 314 #define MAYBE_CallWithAecDump CallWithAecDump
303 #endif 315 #endif
304 316
305 // This tests will make a complete PeerConnection-based call, verify that 317 // This tests will make a complete PeerConnection-based call, verify that
306 // video is playing for the call, and verify that a non-empty AEC dump file 318 // video is playing for the call, and verify that a non-empty AEC dump file
307 // exists. The AEC dump is enabled through webrtc-internals, in contrast to 319 // exists. The AEC dump is enabled through webrtc-internals, in contrast to
308 // using a command line flag (tested in webrtc_aecdump_browsertest.cc). The HTML 320 // using a command line flag (tested in webrtc_aecdump_browsertest.cc). The HTML
309 // and Javascript is bypassed since it would trigger a file picker dialog. 321 // and Javascript is bypassed since it would trigger a file picker dialog.
310 // Instead, the dialog callback FileSelected() is invoked directly. In fact, 322 // Instead, the dialog callback FileSelected() is invoked directly. In fact,
311 // there's never a webrtc-internals page opened at all since that's not needed. 323 // there's never a webrtc-internals page opened at all since that's not needed.
312 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithAecDump) { 324 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CallWithAecDump) {
313 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 325 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
314 326
315 // We must navigate somewhere first so that the render process is created. 327 // We must navigate somewhere first so that the render process is created.
316 NavigateToURL(shell(), GURL("")); 328 NavigateToURL(shell(), GURL(""));
317 329
318 base::FilePath dump_file; 330 base::FilePath dump_file;
319 ASSERT_TRUE(CreateTemporaryFile(&dump_file)); 331 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
320 332
321 // This fakes the behavior of another open tab with webrtc-internals, and 333 // This fakes the behavior of another open tab with webrtc-internals, and
322 // enabling AEC dump in that tab. 334 // enabling AEC dump in that tab.
(...skipping 14 matching lines...) Expand all
337 349
338 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 350 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
339 // Timing out on ARM linux bot: http://crbug.com/238490 351 // Timing out on ARM linux bot: http://crbug.com/238490
340 #define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabled ThenDisabled 352 #define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabled ThenDisabled
341 #else 353 #else
342 #define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisab led 354 #define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisab led
343 #endif 355 #endif
344 356
345 // As above, but enable and disable dump before starting a call. The file should 357 // As above, but enable and disable dump before starting a call. The file should
346 // be created, but should be empty. 358 // be created, but should be empty.
347 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 359 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest,
348 MAYBE_CallWithAecDumpEnabledThenDisabled) { 360 MAYBE_CallWithAecDumpEnabledThenDisabled) {
349 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 361 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
350 362
351 // We must navigate somewhere first so that the render process is created. 363 // We must navigate somewhere first so that the render process is created.
352 NavigateToURL(shell(), GURL("")); 364 NavigateToURL(shell(), GURL(""));
353 365
354 base::FilePath dump_file; 366 base::FilePath dump_file;
355 ASSERT_TRUE(CreateTemporaryFile(&dump_file)); 367 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
356 368
357 // This fakes the behavior of another open tab with webrtc-internals, and 369 // This fakes the behavior of another open tab with webrtc-internals, and
358 // enabling AEC dump in that tab, then disabling it. 370 // enabling AEC dump in that tab, then disabling it.
359 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL); 371 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
360 WebRTCInternals::GetInstance()->DisableAecDump(); 372 WebRTCInternals::GetInstance()->DisableAecDump();
361 373
362 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 374 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
363 NavigateToURL(shell(), url); 375 NavigateToURL(shell(), url);
364 DisableOpusIfOnAndroid(); 376 DisableOpusIfOnAndroid();
365 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});"); 377 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
366 378
367 EXPECT_TRUE(base::PathExists(dump_file)); 379 EXPECT_TRUE(base::PathExists(dump_file));
368 int64 file_size = 0; 380 int64 file_size = 0;
369 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 381 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
370 EXPECT_EQ(0, file_size); 382 EXPECT_EQ(0, file_size);
371 383
372 base::DeleteFile(dump_file, false); 384 base::DeleteFile(dump_file, false);
373 } 385 }
374 386
375 } // namespace content 387 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698