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