| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/media/webrtc_browsertest_base.h" | 8 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 9 #include "chrome/browser/media/webrtc_browsertest_common.h" | 9 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 #if !defined(OS_MACOSX) | 75 #if !defined(OS_MACOSX) |
| 76 // Video is choppy on Mac OS X. http://crbug.com/443542. | 76 // Video is choppy on Mac OS X. http://crbug.com/443542. |
| 77 WaitForVideoToPlay(left_tab); | 77 WaitForVideoToPlay(left_tab); |
| 78 WaitForVideoToPlay(right_tab); | 78 WaitForVideoToPlay(right_tab); |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 HangUp(left_tab); | 81 HangUp(left_tab); |
| 82 HangUp(right_tab); | 82 HangUp(right_tab); |
| 83 } | 83 } |
| 84 |
| 85 void RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate( |
| 86 const std::string& cert_keygen_alg = |
| 87 WebRtcTestBase::kUseDefaultCertKeygen) { |
| 88 if (OnWinXp()) return; |
| 89 |
| 90 ASSERT_TRUE(embedded_test_server()->Start()); |
| 91 |
| 92 content::WebContents* left_tab = |
| 93 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 94 content::WebContents* right_tab = |
| 95 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 96 |
| 97 // Generate and clone a certificate, resulting in JavaScript variable |
| 98 // |gCertificateClone| being set to the resulting clone. |
| 99 DeleteDatabase(left_tab); |
| 100 OpenDatabase(left_tab); |
| 101 GenerateAndCloneCertificate(left_tab, cert_keygen_alg); |
| 102 CloseDatabase(left_tab); |
| 103 DeleteDatabase(left_tab); |
| 104 |
| 105 SetupPeerconnectionWithCertificateAndLocalStream( |
| 106 left_tab, "gCertificateClone"); |
| 107 SetupPeerconnectionWithLocalStream(right_tab, cert_keygen_alg); |
| 108 |
| 109 NegotiateCall(left_tab, right_tab, WebRtcTestBase::kUseDefaultVideoCodec); |
| 110 |
| 111 StartDetectingVideo(left_tab, "remote-view"); |
| 112 StartDetectingVideo(right_tab, "remote-view"); |
| 113 |
| 114 #if !defined(OS_MACOSX) |
| 115 // Video is choppy on Mac OS X. http://crbug.com/443542. |
| 116 WaitForVideoToPlay(left_tab); |
| 117 WaitForVideoToPlay(right_tab); |
| 118 #endif |
| 119 |
| 120 HangUp(left_tab); |
| 121 HangUp(right_tab); |
| 122 } |
| 84 }; | 123 }; |
| 85 | 124 |
| 86 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 125 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 87 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerRsa) { | |
| 88 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | |
| 89 kKeygenAlgorithmRsa, | |
| 90 kKeygenAlgorithmRsa); | |
| 91 } | |
| 92 | |
| 93 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | |
| 94 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerEcdsa) { | |
| 95 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | |
| 96 kKeygenAlgorithmEcdsa, | |
| 97 kKeygenAlgorithmEcdsa); | |
| 98 } | |
| 99 | |
| 100 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | |
| 101 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerEcdsa) { | |
| 102 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | |
| 103 kKeygenAlgorithmRsa, | |
| 104 kKeygenAlgorithmEcdsa); | |
| 105 } | |
| 106 | |
| 107 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | |
| 108 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) { | |
| 109 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | |
| 110 kKeygenAlgorithmEcdsa, | |
| 111 kKeygenAlgorithmRsa); | |
| 112 } | |
| 113 | |
| 114 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | |
| 115 RunsAudioVideoWebRTCCallInTwoTabsVP8) { | 126 RunsAudioVideoWebRTCCallInTwoTabsVP8) { |
| 116 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); | 127 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); |
| 117 } | 128 } |
| 118 | 129 |
| 119 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 130 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 120 RunsAudioVideoWebRTCCallInTwoTabsVP9) { | 131 RunsAudioVideoWebRTCCallInTwoTabsVP9) { |
| 121 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); | 132 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); |
| 122 } | 133 } |
| 123 | 134 |
| 124 #if BUILDFLAG(RTC_USE_H264) | 135 #if BUILDFLAG(RTC_USE_H264) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 146 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); | 157 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); |
| 147 ui_test_utils::NavigateToURL(browser(), url); | 158 ui_test_utils::NavigateToURL(browser(), url); |
| 148 content::WebContents* tab = | 159 content::WebContents* tab = |
| 149 browser()->tab_strip_model()->GetActiveWebContents(); | 160 browser()->tab_strip_model()->GetActiveWebContents(); |
| 150 | 161 |
| 151 // A sleep is necessary to be able to detect the crash. | 162 // A sleep is necessary to be able to detect the crash. |
| 152 test::SleepInJavascript(tab, 1000); | 163 test::SleepInJavascript(tab, 1000); |
| 153 | 164 |
| 154 ASSERT_FALSE(tab->IsCrashed()); | 165 ASSERT_FALSE(tab->IsCrashed()); |
| 155 } | 166 } |
| 167 |
| 168 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 169 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerRsa) { |
| 170 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, |
| 171 kKeygenAlgorithmRsa, |
| 172 kKeygenAlgorithmRsa); |
| 173 } |
| 174 |
| 175 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 176 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerEcdsa) { |
| 177 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, |
| 178 kKeygenAlgorithmEcdsa, |
| 179 kKeygenAlgorithmEcdsa); |
| 180 } |
| 181 |
| 182 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 183 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerEcdsa) { |
| 184 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, |
| 185 kKeygenAlgorithmRsa, |
| 186 kKeygenAlgorithmEcdsa); |
| 187 } |
| 188 |
| 189 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
| 190 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) { |
| 191 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, |
| 192 kKeygenAlgorithmEcdsa, |
| 193 kKeygenAlgorithmRsa); |
| 194 } |
| 195 |
| 196 IN_PROC_BROWSER_TEST_F( |
| 197 WebRtcBrowserTest, |
| 198 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateRsa) { |
| 199 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmRsa); |
| 200 } |
| 201 |
| 202 IN_PROC_BROWSER_TEST_F( |
| 203 WebRtcBrowserTest, |
| 204 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateEcdsa) { |
| 205 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmEcdsa); |
| 206 } |
| OLD | NEW |