| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/test/ui/ui_test.h" | 27 #include "chrome/test/ui/ui_test.h" |
| 28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
| 29 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/test/browser_test_utils.h" | 30 #include "content/public/test/browser_test_utils.h" |
| 31 #include "net/test/embedded_test_server/embedded_test_server.h" | 31 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 32 #include "testing/perf/perf_test.h" | 32 #include "testing/perf/perf_test.h" |
| 33 | 33 |
| 34 static const char kMainWebrtcTestHtmlPage[] = | 34 static const char kMainWebrtcTestHtmlPage[] = |
| 35 "/webrtc/webrtc_jsep01_test.html"; | 35 "/webrtc/webrtc_jsep01_test.html"; |
| 36 | 36 |
| 37 // Temporarily disabled on Linux. |
| 38 // http://crbug.com/281268. |
| 39 #if defined(OS_LINUX) |
| 40 #define MAYBE_WebrtcBrowserTest DISABLED_WebrtcBrowserTest |
| 41 #else |
| 42 #define MAYBE_WebrtcBrowserTest WebrtcBrowserTest |
| 43 #endif |
| 44 |
| 37 // Top-level integration test for WebRTC. Requires a real webcam and microphone | 45 // Top-level integration test for WebRTC. Requires a real webcam and microphone |
| 38 // on the running system. This test is not meant to run in the main browser | 46 // on the running system. This test is not meant to run in the main browser |
| 39 // test suite since normal tester machines do not have webcams. | 47 // test suite since normal tester machines do not have webcams. |
| 40 class WebrtcBrowserTest : public WebRtcTestBase { | 48 class MAYBE_WebrtcBrowserTest : public WebRtcTestBase { |
| 41 public: | 49 public: |
| 42 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 50 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 43 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); | 51 PeerConnectionServerRunner::KillAllPeerConnectionServersOnCurrentSystem(); |
| 44 } | 52 } |
| 45 | 53 |
| 46 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 54 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 47 // This test expects real device handling and requires a real webcam / audio | 55 // This test expects real device handling and requires a real webcam / audio |
| 48 // device; it will not work with fake devices. | 56 // device; it will not work with fake devices. |
| 49 EXPECT_FALSE(command_line->HasSwitch( | 57 EXPECT_FALSE(command_line->HasSwitch( |
| 50 switches::kUseFakeDeviceForMediaStream)); | 58 switches::kUseFakeDeviceForMediaStream)); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); | 189 browser(), embedded_test_server()->GetURL(kMainWebrtcTestHtmlPage)); |
| 182 content::WebContents* left_tab = | 190 content::WebContents* left_tab = |
| 183 browser()->tab_strip_model()->GetActiveWebContents(); | 191 browser()->tab_strip_model()->GetActiveWebContents(); |
| 184 GetUserMediaAndAccept(left_tab); | 192 GetUserMediaAndAccept(left_tab); |
| 185 return left_tab; | 193 return left_tab; |
| 186 } | 194 } |
| 187 | 195 |
| 188 PeerConnectionServerRunner peerconnection_server_; | 196 PeerConnectionServerRunner peerconnection_server_; |
| 189 }; | 197 }; |
| 190 | 198 |
| 191 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, | 199 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 192 MANUAL_RunsAudioVideoWebRTCCallInTwoTabs) { | 200 MANUAL_RunsAudioVideoWebRTCCallInTwoTabs) { |
| 193 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 201 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 194 ASSERT_TRUE(peerconnection_server_.Start()); | 202 ASSERT_TRUE(peerconnection_server_.Start()); |
| 195 | 203 |
| 196 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); | 204 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 197 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); | 205 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 198 | 206 |
| 199 EstablishCall(left_tab, right_tab); | 207 EstablishCall(left_tab, right_tab); |
| 200 | 208 |
| 201 StartDetectingVideo(left_tab, "remote-view"); | 209 StartDetectingVideo(left_tab, "remote-view"); |
| 202 StartDetectingVideo(right_tab, "remote-view"); | 210 StartDetectingVideo(right_tab, "remote-view"); |
| 203 | 211 |
| 204 WaitForVideoToPlay(left_tab); | 212 WaitForVideoToPlay(left_tab); |
| 205 WaitForVideoToPlay(right_tab); | 213 WaitForVideoToPlay(right_tab); |
| 206 | 214 |
| 207 HangUp(left_tab); | 215 HangUp(left_tab); |
| 208 WaitUntilHangupVerified(left_tab); | 216 WaitUntilHangupVerified(left_tab); |
| 209 WaitUntilHangupVerified(right_tab); | 217 WaitUntilHangupVerified(right_tab); |
| 210 | 218 |
| 211 AssertNoAsynchronousErrors(left_tab); | 219 AssertNoAsynchronousErrors(left_tab); |
| 212 AssertNoAsynchronousErrors(right_tab); | 220 AssertNoAsynchronousErrors(right_tab); |
| 213 | 221 |
| 214 ASSERT_TRUE(peerconnection_server_.Stop()); | 222 ASSERT_TRUE(peerconnection_server_.Stop()); |
| 215 } | 223 } |
| 216 | 224 |
| 217 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, MANUAL_CpuUsage15Seconds) { | 225 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, MANUAL_CpuUsage15Seconds) { |
| 218 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 226 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 219 ASSERT_TRUE(peerconnection_server_.Start()); | 227 ASSERT_TRUE(peerconnection_server_.Start()); |
| 220 | 228 |
| 221 base::FilePath results_file; | 229 base::FilePath results_file; |
| 222 ASSERT_TRUE(file_util::CreateTemporaryFile(&results_file)); | 230 ASSERT_TRUE(file_util::CreateTemporaryFile(&results_file)); |
| 223 | 231 |
| 224 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); | 232 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 225 | 233 |
| 226 #if defined(OS_MACOSX) | 234 #if defined(OS_MACOSX) |
| 227 // Don't measure renderer CPU on mac: requires a mach broker we don't have | 235 // Don't measure renderer CPU on mac: requires a mach broker we don't have |
| (...skipping 30 matching lines...) Expand all Loading... |
| 258 PrintProcessMetrics(renderer_process_metrics.get(), "_r"); | 266 PrintProcessMetrics(renderer_process_metrics.get(), "_r"); |
| 259 #endif | 267 #endif |
| 260 PrintProcessMetrics(browser_process_metrics.get(), "_b"); | 268 PrintProcessMetrics(browser_process_metrics.get(), "_b"); |
| 261 | 269 |
| 262 AssertNoAsynchronousErrors(left_tab); | 270 AssertNoAsynchronousErrors(left_tab); |
| 263 AssertNoAsynchronousErrors(right_tab); | 271 AssertNoAsynchronousErrors(right_tab); |
| 264 | 272 |
| 265 ASSERT_TRUE(peerconnection_server_.Stop()); | 273 ASSERT_TRUE(peerconnection_server_.Stop()); |
| 266 } | 274 } |
| 267 | 275 |
| 268 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, | 276 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 269 MANUAL_TestMediaStreamTrackEnableDisable) { | 277 MANUAL_TestMediaStreamTrackEnableDisable) { |
| 270 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 278 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 271 ASSERT_TRUE(peerconnection_server_.Start()); | 279 ASSERT_TRUE(peerconnection_server_.Start()); |
| 272 | 280 |
| 273 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); | 281 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 274 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); | 282 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 275 | 283 |
| 276 EstablishCall(left_tab, right_tab); | 284 EstablishCall(left_tab, right_tab); |
| 277 | 285 |
| 278 StartDetectingVideo(left_tab, "remote-view"); | 286 StartDetectingVideo(left_tab, "remote-view"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 292 HangUp(left_tab); | 300 HangUp(left_tab); |
| 293 WaitUntilHangupVerified(left_tab); | 301 WaitUntilHangupVerified(left_tab); |
| 294 WaitUntilHangupVerified(right_tab); | 302 WaitUntilHangupVerified(right_tab); |
| 295 | 303 |
| 296 AssertNoAsynchronousErrors(left_tab); | 304 AssertNoAsynchronousErrors(left_tab); |
| 297 AssertNoAsynchronousErrors(right_tab); | 305 AssertNoAsynchronousErrors(right_tab); |
| 298 | 306 |
| 299 ASSERT_TRUE(peerconnection_server_.Stop()); | 307 ASSERT_TRUE(peerconnection_server_.Stop()); |
| 300 } | 308 } |
| 301 | 309 |
| 302 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, | 310 IN_PROC_BROWSER_TEST_F(MAYBE_WebrtcBrowserTest, |
| 303 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetrics) { | 311 MANUAL_RunsAudioVideoCall60SecsAndLogsInternalMetrics) { |
| 304 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 312 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 305 ASSERT_TRUE(peerconnection_server_.Start()); | 313 ASSERT_TRUE(peerconnection_server_.Start()); |
| 306 | 314 |
| 307 ASSERT_GT(TestTimeouts::action_max_timeout().InSeconds(), 80) << | 315 ASSERT_GT(TestTimeouts::action_max_timeout().InSeconds(), 80) << |
| 308 "This is a long-running test; you must specify " | 316 "This is a long-running test; you must specify " |
| 309 "--ui-test-action-max-timeout to have a value of at least 80000."; | 317 "--ui-test-action-max-timeout to have a value of at least 80000."; |
| 310 | 318 |
| 311 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); | 319 content::WebContents* left_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| 312 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); | 320 content::WebContents* right_tab = OpenTestPageAndGetUserMediaInNewTab(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 342 | 350 |
| 343 HangUp(left_tab); | 351 HangUp(left_tab); |
| 344 WaitUntilHangupVerified(left_tab); | 352 WaitUntilHangupVerified(left_tab); |
| 345 WaitUntilHangupVerified(right_tab); | 353 WaitUntilHangupVerified(right_tab); |
| 346 | 354 |
| 347 AssertNoAsynchronousErrors(left_tab); | 355 AssertNoAsynchronousErrors(left_tab); |
| 348 AssertNoAsynchronousErrors(right_tab); | 356 AssertNoAsynchronousErrors(right_tab); |
| 349 | 357 |
| 350 ASSERT_TRUE(peerconnection_server_.Stop()); | 358 ASSERT_TRUE(peerconnection_server_.Stop()); |
| 351 } | 359 } |
| OLD | NEW |