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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 | 49 |
50 // Flag used by TestWebAudioMediaStream to force garbage collection. | 50 // Flag used by TestWebAudioMediaStream to force garbage collection. |
51 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 51 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
52 } | 52 } |
53 | 53 |
54 void RunsAudioVideoWebRTCCallInTwoTabs( | 54 void RunsAudioVideoWebRTCCallInTwoTabs( |
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 bool get_stats = false) { | |
phoglund_chromium
2016/07/27 12:52:10
Instead of adding a new parameter, maybe inline th
hbos_chromium
2016/07/27 13:50:31
Done.
| |
60 StartServerAndOpenTabs(); | 61 StartServerAndOpenTabs(); |
61 | 62 |
62 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg); | 63 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg); |
63 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg); | 64 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg); |
64 | 65 |
65 NegotiateCall(left_tab_, right_tab_, video_codec); | 66 NegotiateCall(left_tab_, right_tab_, video_codec); |
66 | 67 |
68 if (get_stats) | |
69 GetStats(left_tab_); | |
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. |
(...skipping 108 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 } |
199 | |
200 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, | |
201 RunsAudioVideoWebRTCCallInTwoTabsGetStats) { | |
202 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, | |
203 WebRtcTestBase::kUseDefaultCertKeygen, | |
204 WebRtcTestBase::kUseDefaultCertKeygen, | |
205 true); | |
206 } | |
OLD | NEW |