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

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

Powered by Google App Engine
This is Rietveld 408576698