| 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/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "chrome/browser/media/webrtc_browsertest_base.h" | 7 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 8 #include "chrome/browser/media/webrtc_browsertest_common.h" | 8 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Flag used by TestWebAudioMediaStream to force garbage collection. | 39 // Flag used by TestWebAudioMediaStream to force garbage collection. |
| 40 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 40 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
| 41 } | 41 } |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 44 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 45 RunsAudioVideoWebRTCCallInTwoTabs) { | 45 RunsAudioVideoWebRTCCallInTwoTabs) { |
| 46 if (OnWinXp()) return; | 46 if (OnWinXp()) return; |
| 47 | 47 |
| 48 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 48 ASSERT_TRUE(embedded_test_server()->Start()); |
| 49 | 49 |
| 50 content::WebContents* left_tab = | 50 content::WebContents* left_tab = |
| 51 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 51 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 52 content::WebContents* right_tab = | 52 content::WebContents* right_tab = |
| 53 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 53 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 54 | 54 |
| 55 SetupPeerconnectionWithLocalStream(left_tab); | 55 SetupPeerconnectionWithLocalStream(left_tab); |
| 56 SetupPeerconnectionWithLocalStream(right_tab); | 56 SetupPeerconnectionWithLocalStream(right_tab); |
| 57 | 57 |
| 58 NegotiateCall(left_tab, right_tab); | 58 NegotiateCall(left_tab, right_tab); |
| 59 | 59 |
| 60 StartDetectingVideo(left_tab, "remote-view"); | 60 StartDetectingVideo(left_tab, "remote-view"); |
| 61 StartDetectingVideo(right_tab, "remote-view"); | 61 StartDetectingVideo(right_tab, "remote-view"); |
| 62 | 62 |
| 63 #if !defined(OS_MACOSX) | 63 #if !defined(OS_MACOSX) |
| 64 // Video is choppy on Mac OS X. http://crbug.com/443542. | 64 // Video is choppy on Mac OS X. http://crbug.com/443542. |
| 65 WaitForVideoToPlay(left_tab); | 65 WaitForVideoToPlay(left_tab); |
| 66 WaitForVideoToPlay(right_tab); | 66 WaitForVideoToPlay(right_tab); |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 HangUp(left_tab); | 69 HangUp(left_tab); |
| 70 HangUp(right_tab); | 70 HangUp(right_tab); |
| 71 } | 71 } |
| 72 | 72 |
| 73 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { | 73 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { |
| 74 // This tests against crash regressions for the WebAudio-MediaStream | 74 // This tests against crash regressions for the WebAudio-MediaStream |
| 75 // integration. | 75 // integration. |
| 76 if (OnWinXp()) return; | 76 if (OnWinXp()) return; |
| 77 | 77 |
| 78 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 78 ASSERT_TRUE(embedded_test_server()->Start()); |
| 79 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 79 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
| 80 ui_test_utils::NavigateToURL(browser(), url); | 80 ui_test_utils::NavigateToURL(browser(), url); |
| 81 content::WebContents* tab = | 81 content::WebContents* tab = |
| 82 browser()->tab_strip_model()->GetActiveWebContents(); | 82 browser()->tab_strip_model()->GetActiveWebContents(); |
| 83 | 83 |
| 84 // A sleep is necessary to be able to detect the crash. | 84 // A sleep is necessary to be able to detect the crash. |
| 85 test::SleepInJavascript(tab, 1000); | 85 test::SleepInJavascript(tab, 1000); |
| 86 | 86 |
| 87 ASSERT_FALSE(tab->IsCrashed()); | 87 ASSERT_FALSE(tab->IsCrashed()); |
| 88 } | 88 } |
| OLD | NEW |