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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const std::string& video_codec = WebRtcTestBase::kUseDefaultVideoCodec, | 55 const std::string& video_codec = WebRtcTestBase::kUseDefaultVideoCodec, |
56 const std::string& offer_cert_keygen_alg = | 56 const std::string& offer_cert_keygen_alg = |
57 WebRtcTestBase::kUseDefaultCertKeygen, | 57 WebRtcTestBase::kUseDefaultCertKeygen, |
58 const std::string& answer_cert_keygen_alg = | 58 const std::string& answer_cert_keygen_alg = |
59 WebRtcTestBase::kUseDefaultCertKeygen) { | 59 WebRtcTestBase::kUseDefaultCertKeygen) { |
60 StartServerAndOpenTabs(); | 60 StartServerAndOpenTabs(); |
61 | 61 |
62 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg); | 62 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg); |
63 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg); | 63 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg); |
64 | 64 |
65 NegotiateCall(left_tab_, right_tab_, video_codec); | 65 if (!video_codec.empty()) { |
| 66 SetDefaultVideoCodec(left_tab_, video_codec); |
| 67 SetDefaultVideoCodec(right_tab_, video_codec); |
| 68 } |
| 69 NegotiateCall(left_tab_, right_tab_); |
66 | 70 |
67 DetectVideoAndHangUp(); | 71 DetectVideoAndHangUp(); |
68 } | 72 } |
69 | 73 |
70 void RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate( | 74 void RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate( |
71 const std::string& cert_keygen_alg = | 75 const std::string& cert_keygen_alg = |
72 WebRtcTestBase::kUseDefaultCertKeygen) { | 76 WebRtcTestBase::kUseDefaultCertKeygen) { |
73 StartServerAndOpenTabs(); | 77 StartServerAndOpenTabs(); |
74 | 78 |
75 // Generate and clone a certificate, resulting in JavaScript variable | 79 // Generate and clone a certificate, resulting in JavaScript variable |
76 // |gCertificateClone| being set to the resulting clone. | 80 // |gCertificateClone| being set to the resulting clone. |
77 DeleteDatabase(left_tab_); | 81 DeleteDatabase(left_tab_); |
78 OpenDatabase(left_tab_); | 82 OpenDatabase(left_tab_); |
79 GenerateAndCloneCertificate(left_tab_, cert_keygen_alg); | 83 GenerateAndCloneCertificate(left_tab_, cert_keygen_alg); |
80 CloseDatabase(left_tab_); | 84 CloseDatabase(left_tab_); |
81 DeleteDatabase(left_tab_); | 85 DeleteDatabase(left_tab_); |
82 | 86 |
83 SetupPeerconnectionWithCertificateAndLocalStream( | 87 SetupPeerconnectionWithCertificateAndLocalStream( |
84 left_tab_, "gCertificateClone"); | 88 left_tab_, "gCertificateClone"); |
85 SetupPeerconnectionWithLocalStream(right_tab_, cert_keygen_alg); | 89 SetupPeerconnectionWithLocalStream(right_tab_, cert_keygen_alg); |
86 | 90 |
87 NegotiateCall(left_tab_, right_tab_, WebRtcTestBase::kUseDefaultVideoCodec); | 91 NegotiateCall(left_tab_, right_tab_); |
88 | 92 |
89 DetectVideoAndHangUp(); | 93 DetectVideoAndHangUp(); |
90 } | 94 } |
91 | 95 |
92 private: | 96 private: |
93 void StartServerAndOpenTabs() { | 97 void StartServerAndOpenTabs() { |
94 ASSERT_TRUE(embedded_test_server()->Start()); | 98 ASSERT_TRUE(embedded_test_server()->Start()); |
95 left_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 99 left_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
96 right_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 100 right_tab_ = OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
97 } | 101 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 kKeygenAlgorithmRsa, | 189 kKeygenAlgorithmRsa, |
186 kKeygenAlgorithmEcdsa); | 190 kKeygenAlgorithmEcdsa); |
187 } | 191 } |
188 | 192 |
189 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | 193 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, |
190 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) { | 194 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) { |
191 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | 195 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, |
192 kKeygenAlgorithmEcdsa, | 196 kKeygenAlgorithmEcdsa, |
193 kKeygenAlgorithmRsa); | 197 kKeygenAlgorithmRsa); |
194 } | 198 } |
OLD | NEW |