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