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 28 matching lines...) Expand all Loading... |
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 static const bool kRunTestsWithFlag[] = { false, true }; | 44 static const bool kRunTestsWithFlag[] = { false, true }; |
45 INSTANTIATE_TEST_CASE_P(WebRtcBrowserTests, | 45 INSTANTIATE_TEST_CASE_P(WebRtcBrowserTests, |
46 WebRtcBrowserTest, | 46 WebRtcBrowserTest, |
47 testing::ValuesIn(kRunTestsWithFlag)); | 47 testing::ValuesIn(kRunTestsWithFlag)); |
48 | 48 |
49 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, | 49 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, RunsAudioVideoWebRTCCallInTwoTabs) { |
50 MANUAL_RunsAudioVideoWebRTCCallInTwoTabs) { | |
51 if (OnWinXp()) return; | 50 if (OnWinXp()) return; |
52 | 51 |
53 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); | |
54 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 52 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
55 | 53 |
56 content::WebContents* left_tab = | 54 content::WebContents* left_tab = |
57 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 55 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
58 content::WebContents* right_tab = | 56 content::WebContents* right_tab = |
59 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 57 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
60 | 58 |
61 SetupPeerconnectionWithLocalStream(left_tab); | 59 SetupPeerconnectionWithLocalStream(left_tab); |
62 SetupPeerconnectionWithLocalStream(right_tab); | 60 SetupPeerconnectionWithLocalStream(right_tab); |
63 | 61 |
64 NegotiateCall(left_tab, right_tab); | 62 NegotiateCall(left_tab, right_tab); |
65 | 63 |
66 StartDetectingVideo(left_tab, "remote-view"); | 64 StartDetectingVideo(left_tab, "remote-view"); |
67 StartDetectingVideo(right_tab, "remote-view"); | 65 StartDetectingVideo(right_tab, "remote-view"); |
68 | 66 |
69 WaitForVideoToPlay(left_tab); | 67 WaitForVideoToPlay(left_tab); |
70 WaitForVideoToPlay(right_tab); | 68 WaitForVideoToPlay(right_tab); |
71 | 69 |
72 HangUp(left_tab); | 70 HangUp(left_tab); |
73 HangUp(right_tab); | 71 HangUp(right_tab); |
74 } | 72 } |
75 | 73 |
76 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MANUAL_TestWebAudioMediaStream) { | 74 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, TestWebAudioMediaStream) { |
77 // This tests against crash regressions for the WebAudio-MediaStream | 75 // This tests against crash regressions for the WebAudio-MediaStream |
78 // integration. | 76 // integration. |
79 if (OnWinXp()) return; | 77 if (OnWinXp()) return; |
80 | 78 |
81 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 79 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
82 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 80 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
83 ui_test_utils::NavigateToURL(browser(), url); | 81 ui_test_utils::NavigateToURL(browser(), url); |
84 content::WebContents* tab = | 82 content::WebContents* tab = |
85 browser()->tab_strip_model()->GetActiveWebContents(); | 83 browser()->tab_strip_model()->GetActiveWebContents(); |
86 | 84 |
87 // A sleep is necessary to be able to detect the crash. | 85 // A sleep is necessary to be able to detect the crash. |
88 test::SleepInJavascript(tab, 1000); | 86 test::SleepInJavascript(tab, 1000); |
89 | 87 |
90 ASSERT_FALSE(tab->IsCrashed()); | 88 ASSERT_FALSE(tab->IsCrashed()); |
91 } | 89 } |
OLD | NEW |