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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 max_width, | 38 max_width, |
39 min_height, | 39 min_height, |
40 max_height, | 40 max_height, |
41 min_frame_rate, | 41 min_frame_rate, |
42 max_frame_rate); | 42 max_frame_rate); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 namespace content { | 46 namespace content { |
47 | 47 |
48 class WebrtcBrowserTest: public ContentBrowserTest { | 48 #if defined(OS_LINUX) |
| 49 // All tests are flaky on Linux: crbug.com/281492. |
| 50 #define MAYBE_WebrtcBrowserTest DISABLED_WebrtcBrowserTest |
| 51 #else |
| 52 #define MAYBE_WebrtcBrowserTest WebrtcBrowserTest |
| 53 #endif |
| 54 |
| 55 class MAYBE_WebrtcBrowserTest: public ContentBrowserTest { |
49 public: | 56 public: |
50 WebrtcBrowserTest() {} | 57 MAYBE_WebrtcBrowserTest() {} |
51 virtual ~WebrtcBrowserTest() {} | 58 virtual ~MAYBE_WebrtcBrowserTest() {} |
52 | 59 |
53 virtual void SetUpOnMainThread() OVERRIDE { | 60 virtual void SetUpOnMainThread() OVERRIDE { |
54 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 61 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
55 } | 62 } |
56 | 63 |
57 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 64 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
58 // We need fake devices in this test since we want to run on naked VMs. We | 65 // We need fake devices in this test since we want to run on naked VMs. We |
59 // assume these switches are set by default in content_browsertests. | 66 // assume these switches are set by default in content_browsertests. |
60 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | 67 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
61 switches::kUseFakeDeviceForMediaStream)); | 68 switches::kUseFakeDeviceForMediaStream)); |
(...skipping 13 matching lines...) Expand all Loading... |
75 void ExpectTitle(const std::string& expected_title) const { | 82 void ExpectTitle(const std::string& expected_title) const { |
76 string16 expected_title16(ASCIIToUTF16(expected_title)); | 83 string16 expected_title16(ASCIIToUTF16(expected_title)); |
77 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); | 84 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); |
78 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 85 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
79 } | 86 } |
80 }; | 87 }; |
81 | 88 |
82 // These tests will all make a getUserMedia call with different constraints and | 89 // These tests will all make a getUserMedia call with different constraints and |
83 // see that the success callback is called. If the error callback is called or | 90 // see that the success callback is called. If the error callback is called or |
84 // none of the callbacks are called the tests will simply time out and fail. | 91 // none of the callbacks are called the tests will simply time out and fail. |
85 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetVideoStreamAndStop) { | 92 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, GetVideoStreamAndStop) { |
86 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 93 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
87 NavigateToURL(shell(), url); | 94 NavigateToURL(shell(), url); |
88 | 95 |
89 EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true});")); | 96 EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true});")); |
90 | 97 |
91 ExpectTitle("OK"); | 98 ExpectTitle("OK"); |
92 } | 99 } |
93 | 100 |
94 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndStop) { | 101 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 102 GetAudioAndVideoStreamAndStop) { |
95 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 103 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
96 NavigateToURL(shell(), url); | 104 NavigateToURL(shell(), url); |
97 | 105 |
98 EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true, audio: true});")); | 106 EXPECT_TRUE(ExecuteJavascript("getUserMedia({video: true, audio: true});")); |
99 | 107 |
100 ExpectTitle("OK"); | 108 ExpectTitle("OK"); |
101 } | 109 } |
102 | 110 |
103 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetAudioAndVideoStreamAndClone) { | 111 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 112 GetAudioAndVideoStreamAndClone) { |
104 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 113 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
105 NavigateToURL(shell(), url); | 114 NavigateToURL(shell(), url); |
106 | 115 |
107 EXPECT_TRUE(ExecuteJavascript("getUserMediaAndClone();")); | 116 EXPECT_TRUE(ExecuteJavascript("getUserMediaAndClone();")); |
108 | 117 |
109 ExpectTitle("OK"); | 118 ExpectTitle("OK"); |
110 } | 119 } |
111 | 120 |
112 | 121 |
113 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 122 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
114 // Timing out on ARM linux bot: http://crbug.com/238490 | 123 // Timing out on ARM linux bot: http://crbug.com/238490 |
115 #define MAYBE_CanSetupVideoCall DISABLED_CanSetupVideoCall | 124 #define MAYBE_CanSetupVideoCall DISABLED_CanSetupVideoCall |
116 #else | 125 #else |
117 #define MAYBE_CanSetupVideoCall CanSetupVideoCall | 126 #define MAYBE_CanSetupVideoCall CanSetupVideoCall |
118 #endif | 127 #endif |
119 | 128 |
120 // These tests will make a complete PeerConnection-based call and verify that | 129 // These tests will make a complete PeerConnection-based call and verify that |
121 // video is playing for the call. | 130 // video is playing for the call. |
122 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupVideoCall) { | 131 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, MAYBE_CanSetupVideoCall) { |
123 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 132 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
124 NavigateToURL(shell(), url); | 133 NavigateToURL(shell(), url); |
125 | 134 |
126 EXPECT_TRUE(ExecuteJavascript("call({video: true});")); | 135 EXPECT_TRUE(ExecuteJavascript("call({video: true});")); |
127 ExpectTitle("OK"); | 136 ExpectTitle("OK"); |
128 } | 137 } |
129 | 138 |
130 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 139 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
131 // Timing out on ARM linux, see http://crbug.com/240376 | 140 // Timing out on ARM linux, see http://crbug.com/240376 |
132 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall | 141 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall |
133 #else | 142 #else |
134 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall | 143 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall |
135 #endif | 144 #endif |
136 | 145 |
137 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) { | 146 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 147 MAYBE_CanSetupAudioAndVideoCall) { |
138 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 148 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
139 NavigateToURL(shell(), url); | 149 NavigateToURL(shell(), url); |
140 | 150 |
141 EXPECT_TRUE(ExecuteJavascript("call({video: true, audio: true});")); | 151 EXPECT_TRUE(ExecuteJavascript("call({video: true, audio: true});")); |
142 ExpectTitle("OK"); | 152 ExpectTitle("OK"); |
143 } | 153 } |
144 | 154 |
145 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) { | 155 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 156 MANUAL_CanSetupCallAndSendDtmf) { |
146 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 157 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
147 NavigateToURL(shell(), url); | 158 NavigateToURL(shell(), url); |
148 | 159 |
149 EXPECT_TRUE( | 160 EXPECT_TRUE( |
150 ExecuteJavascript("callAndSendDtmf('123,abc');")); | 161 ExecuteJavascript("callAndSendDtmf('123,abc');")); |
151 } | 162 } |
152 | 163 |
153 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, | 164 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
154 CanMakeEmptyCallThenAddStreamsAndRenegotiate) { | 165 CanMakeEmptyCallThenAddStreamsAndRenegotiate) { |
155 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 166 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
156 NavigateToURL(shell(), url); | 167 NavigateToURL(shell(), url); |
157 | 168 |
158 const char* kJavascript = | 169 const char* kJavascript = |
159 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});"; | 170 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});"; |
160 EXPECT_TRUE(ExecuteJavascript(kJavascript)); | 171 EXPECT_TRUE(ExecuteJavascript(kJavascript)); |
161 ExpectTitle("OK"); | 172 ExpectTitle("OK"); |
162 } | 173 } |
163 | 174 |
164 // This test will make a complete PeerConnection-based call but remove the | 175 // This test will make a complete PeerConnection-based call but remove the |
165 // MSID and bundle attribute from the initial offer to verify that | 176 // MSID and bundle attribute from the initial offer to verify that |
166 // video is playing for the call even if the initiating client don't support | 177 // video is playing for the call even if the initiating client don't support |
167 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02 | 178 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02 |
168 #if defined(OS_WIN) && defined(USE_AURA) | 179 #if defined(OS_WIN) && defined(USE_AURA) |
169 // Disabled for win7_aura, see http://crbug.com/235089. | 180 // Disabled for win7_aura, see http://crbug.com/235089. |
170 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ | 181 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ |
171 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle | 182 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle |
172 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 183 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
173 // Timing out on ARM linux, see http://crbug.com/240373 | 184 // Timing out on ARM linux, see http://crbug.com/240373 |
174 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ | 185 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ |
175 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle | 186 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle |
176 #else | 187 #else |
177 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ | 188 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ |
178 CanSetupAudioAndVideoCallWithoutMsidAndBundle | 189 CanSetupAudioAndVideoCallWithoutMsidAndBundle |
179 #endif | 190 #endif |
180 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, | 191 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
181 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) { | 192 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) { |
182 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 193 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
183 NavigateToURL(shell(), url); | 194 NavigateToURL(shell(), url); |
184 | 195 |
185 EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();")); | 196 EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();")); |
186 ExpectTitle("OK"); | 197 ExpectTitle("OK"); |
187 } | 198 } |
188 | 199 |
189 // This test will make a PeerConnection-based call and test an unreliable text | 200 // This test will make a PeerConnection-based call and test an unreliable text |
190 // dataChannel. | 201 // dataChannel. |
191 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CallWithDataOnly) { | 202 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, CallWithDataOnly) { |
192 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 203 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
193 NavigateToURL(shell(), url); | 204 NavigateToURL(shell(), url); |
194 | 205 |
195 EXPECT_TRUE(ExecuteJavascript("callWithDataOnly();")); | 206 EXPECT_TRUE(ExecuteJavascript("callWithDataOnly();")); |
196 ExpectTitle("OK"); | 207 ExpectTitle("OK"); |
197 } | 208 } |
198 | 209 |
199 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 210 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
200 // Timing out on ARM linux bot: http://crbug.com/238490 | 211 // Timing out on ARM linux bot: http://crbug.com/238490 |
201 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia | 212 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia |
202 #else | 213 #else |
203 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia | 214 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia |
204 #endif | 215 #endif |
205 | 216 |
206 // This test will make a PeerConnection-based call and test an unreliable text | 217 // This test will make a PeerConnection-based call and test an unreliable text |
207 // dataChannel and audio and video tracks. | 218 // dataChannel and audio and video tracks. |
208 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithDataAndMedia) { | 219 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, MAYBE_CallWithDataAndMedia) { |
209 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 220 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
210 NavigateToURL(shell(), url); | 221 NavigateToURL(shell(), url); |
211 | 222 |
212 EXPECT_TRUE(ExecuteJavascript("callWithDataAndMedia();")); | 223 EXPECT_TRUE(ExecuteJavascript("callWithDataAndMedia();")); |
213 ExpectTitle("OK"); | 224 ExpectTitle("OK"); |
214 } | 225 } |
215 | 226 |
216 #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) |
217 // Timing out on ARM linux bot: http://crbug.com/238490 | 228 // Timing out on ARM linux bot: http://crbug.com/238490 |
218 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia | 229 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia |
219 #else | 230 #else |
220 #define MAYBE_CallWithDataAndLaterAddMedia CallWithDataAndLaterAddMedia | 231 #define MAYBE_CallWithDataAndLaterAddMedia CallWithDataAndLaterAddMedia |
221 #endif | 232 #endif |
222 | 233 |
223 // This test will make a PeerConnection-based call and test an unreliable text | 234 // This test will make a PeerConnection-based call and test an unreliable text |
224 // dataChannel and later add an audio and video track. | 235 // dataChannel and later add an audio and video track. |
225 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) { | 236 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 237 MAYBE_CallWithDataAndLaterAddMedia) { |
226 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 238 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
227 NavigateToURL(shell(), url); | 239 NavigateToURL(shell(), url); |
228 | 240 |
229 EXPECT_TRUE(ExecuteJavascript("callWithDataAndLaterAddMedia();")); | 241 EXPECT_TRUE(ExecuteJavascript("callWithDataAndLaterAddMedia();")); |
230 ExpectTitle("OK"); | 242 ExpectTitle("OK"); |
231 } | 243 } |
232 | 244 |
233 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 245 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
234 // Timing out on ARM linux bot: http://crbug.com/238490 | 246 // Timing out on ARM linux bot: http://crbug.com/238490 |
235 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream | 247 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream |
236 #else | 248 #else |
237 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream | 249 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream |
238 #endif | 250 #endif |
239 | 251 |
240 // 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 |
241 // MediaStream that has been created based on a MediaStream created with | 253 // MediaStream that has been created based on a MediaStream created with |
242 // getUserMedia. | 254 // getUserMedia. |
243 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) { | 255 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 256 MAYBE_CallWithNewVideoMediaStream) { |
244 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 257 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
245 NavigateToURL(shell(), url); | 258 NavigateToURL(shell(), url); |
246 | 259 |
247 EXPECT_TRUE(ExecuteJavascript("callWithNewVideoMediaStream();")); | 260 EXPECT_TRUE(ExecuteJavascript("callWithNewVideoMediaStream();")); |
248 ExpectTitle("OK"); | 261 ExpectTitle("OK"); |
249 } | 262 } |
250 | 263 |
251 // This test will make a PeerConnection-based call and send a new Video | 264 // This test will make a PeerConnection-based call and send a new Video |
252 // MediaStream that has been created based on a MediaStream created with | 265 // MediaStream that has been created based on a MediaStream created with |
253 // getUserMedia. When video is flowing, the VideoTrack is removed and an | 266 // getUserMedia. When video is flowing, the VideoTrack is removed and an |
254 // AudioTrack is added instead. | 267 // AudioTrack is added instead. |
255 // TODO(phoglund): This test is manual since not all buildbots has an audio | 268 // TODO(phoglund): This test is manual since not all buildbots has an audio |
256 // input. | 269 // input. |
257 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CallAndModifyStream) { | 270 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, MANUAL_CallAndModifyStream) { |
258 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 271 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
259 NavigateToURL(shell(), url); | 272 NavigateToURL(shell(), url); |
260 | 273 |
261 EXPECT_TRUE( | 274 EXPECT_TRUE( |
262 ExecuteJavascript("callWithNewVideoMediaStreamLaterSwitchToAudio();")); | 275 ExecuteJavascript("callWithNewVideoMediaStreamLaterSwitchToAudio();")); |
263 ExpectTitle("OK"); | 276 ExpectTitle("OK"); |
264 } | 277 } |
265 | 278 |
266 // This test calls getUserMedia in sequence with different constraints. | 279 // This test calls getUserMedia in sequence with different constraints. |
267 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, TestGetUserMediaConstraints) { | 280 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, TestGetUserMediaConstraints) { |
268 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 281 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
269 | 282 |
270 std::vector<std::string> list_of_get_user_media_calls; | 283 std::vector<std::string> list_of_get_user_media_calls; |
271 list_of_get_user_media_calls.push_back( | 284 list_of_get_user_media_calls.push_back( |
272 GenerateGetUserMediaCall(kGetUserMedia, 320, 320, 180, 180, 30, 30)); | 285 GenerateGetUserMediaCall(kGetUserMedia, 320, 320, 180, 180, 30, 30)); |
273 list_of_get_user_media_calls.push_back( | 286 list_of_get_user_media_calls.push_back( |
274 GenerateGetUserMediaCall(kGetUserMedia, 320, 320, 240, 240, 30, 30)); | 287 GenerateGetUserMediaCall(kGetUserMedia, 320, 320, 240, 240, 30, 30)); |
275 list_of_get_user_media_calls.push_back( | 288 list_of_get_user_media_calls.push_back( |
276 GenerateGetUserMediaCall(kGetUserMedia, 640, 640, 360, 360, 30, 30)); | 289 GenerateGetUserMediaCall(kGetUserMedia, 640, 640, 360, 360, 30, 30)); |
277 list_of_get_user_media_calls.push_back( | 290 list_of_get_user_media_calls.push_back( |
(...skipping 10 matching lines...) Expand all Loading... |
288 const_iterator != list_of_get_user_media_calls.end(); | 301 const_iterator != list_of_get_user_media_calls.end(); |
289 ++const_iterator) { | 302 ++const_iterator) { |
290 DVLOG(1) << "Calling getUserMedia: " << *const_iterator; | 303 DVLOG(1) << "Calling getUserMedia: " << *const_iterator; |
291 NavigateToURL(shell(), url); | 304 NavigateToURL(shell(), url); |
292 EXPECT_TRUE(ExecuteJavascript(*const_iterator)); | 305 EXPECT_TRUE(ExecuteJavascript(*const_iterator)); |
293 ExpectTitle("OK"); | 306 ExpectTitle("OK"); |
294 } | 307 } |
295 } | 308 } |
296 | 309 |
297 // This test calls getUserMedia and checks for aspect ratio behavior. | 310 // This test calls getUserMedia and checks for aspect ratio behavior. |
298 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, TestGetUserMediaAspectRatio) { | 311 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, TestGetUserMediaAspectRatio) { |
299 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 312 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
300 | 313 |
301 std::string constraints_4_3 = GenerateGetUserMediaCall( | 314 std::string constraints_4_3 = GenerateGetUserMediaCall( |
302 kGetUserMediaWithAnalysis, 640, 640, 480, 480, 30, 30); | 315 kGetUserMediaWithAnalysis, 640, 640, 480, 480, 30, 30); |
303 std::string constraints_16_9 = GenerateGetUserMediaCall( | 316 std::string constraints_16_9 = GenerateGetUserMediaCall( |
304 kGetUserMediaWithAnalysis, 640, 640, 360, 360, 30, 30); | 317 kGetUserMediaWithAnalysis, 640, 640, 360, 360, 30, 30); |
305 | 318 |
306 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594. | 319 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594. |
307 | 320 |
308 NavigateToURL(shell(), url); | 321 NavigateToURL(shell(), url); |
309 EXPECT_TRUE(ExecuteJavascript(constraints_4_3)); | 322 EXPECT_TRUE(ExecuteJavascript(constraints_4_3)); |
310 ExpectTitle("4:3 letterbox"); | 323 ExpectTitle("4:3 letterbox"); |
311 | 324 |
312 NavigateToURL(shell(), url); | 325 NavigateToURL(shell(), url); |
313 EXPECT_TRUE(ExecuteJavascript(constraints_16_9)); | 326 EXPECT_TRUE(ExecuteJavascript(constraints_16_9)); |
314 ExpectTitle("16:9 letterbox"); | 327 ExpectTitle("16:9 letterbox"); |
315 } | 328 } |
316 | 329 |
317 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, AddTwoMediaStreamsToOnePC) { | 330 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, AddTwoMediaStreamsToOnePC) { |
318 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 331 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
319 NavigateToURL(shell(), url); | 332 NavigateToURL(shell(), url); |
320 | 333 |
321 EXPECT_TRUE( | 334 EXPECT_TRUE( |
322 ExecuteJavascript("addTwoMediaStreamsToOneConnection();")); | 335 ExecuteJavascript("addTwoMediaStreamsToOneConnection();")); |
323 ExpectTitle("OK"); | 336 ExpectTitle("OK"); |
324 } | 337 } |
325 | 338 |
326 } // namespace content | 339 } // namespace content |
OLD | NEW |