Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/media/webrtc/webrtc_browsertest.cc

Issue 2985263002: Reland of RTCVideoEncoder: Report H264 profile information to WebRTC (Closed)
Patch Set: Add default argument to SetDefaultVideoCodec Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" 7 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
8 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" 8 #include "chrome/browser/media/webrtc/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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Always use fake devices. 46 // Always use fake devices.
47 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); 47 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);
48 48
49 // Flag used by TestWebAudioMediaStream to force garbage collection. 49 // Flag used by TestWebAudioMediaStream to force garbage collection.
50 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); 50 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc");
51 } 51 }
52 52
53 void RunsAudioVideoWebRTCCallInTwoTabs( 53 void RunsAudioVideoWebRTCCallInTwoTabs(
54 const std::string& video_codec = WebRtcTestBase::kUseDefaultVideoCodec, 54 const std::string& video_codec = WebRtcTestBase::kUseDefaultVideoCodec,
55 bool prefer_hw_video_codec = false,
55 const std::string& offer_cert_keygen_alg = 56 const std::string& offer_cert_keygen_alg =
56 WebRtcTestBase::kUseDefaultCertKeygen, 57 WebRtcTestBase::kUseDefaultCertKeygen,
57 const std::string& answer_cert_keygen_alg = 58 const std::string& answer_cert_keygen_alg =
58 WebRtcTestBase::kUseDefaultCertKeygen) { 59 WebRtcTestBase::kUseDefaultCertKeygen) {
59 StartServerAndOpenTabs(); 60 StartServerAndOpenTabs();
60 61
61 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg); 62 SetupPeerconnectionWithLocalStream(left_tab_, offer_cert_keygen_alg);
62 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg); 63 SetupPeerconnectionWithLocalStream(right_tab_, answer_cert_keygen_alg);
63 64
64 if (!video_codec.empty()) { 65 if (!video_codec.empty()) {
65 SetDefaultVideoCodec(left_tab_, video_codec); 66 SetDefaultVideoCodec(left_tab_, video_codec, prefer_hw_video_codec);
66 SetDefaultVideoCodec(right_tab_, video_codec); 67 SetDefaultVideoCodec(right_tab_, video_codec, prefer_hw_video_codec);
67 } 68 }
68 NegotiateCall(left_tab_, right_tab_); 69 NegotiateCall(left_tab_, right_tab_);
69 70
70 DetectVideoAndHangUp(); 71 DetectVideoAndHangUp();
71 } 72 }
72 73
73 void RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate( 74 void RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(
74 const std::string& cert_keygen_alg = 75 const std::string& cert_keygen_alg =
75 WebRtcTestBase::kUseDefaultCertKeygen) { 76 WebRtcTestBase::kUseDefaultCertKeygen) {
76 StartServerAndOpenTabs(); 77 StartServerAndOpenTabs();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 131
131 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 132 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
132 RunsAudioVideoWebRTCCallInTwoTabsH264) { 133 RunsAudioVideoWebRTCCallInTwoTabsH264) {
133 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. 134 // Only run test if run-time feature corresponding to |rtc_use_h264| is on.
134 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { 135 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) {
135 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " 136 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
136 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 " 137 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 "
137 "(test \"OK\")"; 138 "(test \"OK\")";
138 return; 139 return;
139 } 140 }
140 RunsAudioVideoWebRTCCallInTwoTabs("H264"); 141 RunsAudioVideoWebRTCCallInTwoTabs("H264", true /* prefer_hw_video_codec */);
141 } 142 }
142 143
143 #endif // BUILDFLAG(RTC_USE_H264) 144 #endif // BUILDFLAG(RTC_USE_H264)
144 145
145 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { 146 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) {
146 // This tests against crash regressions for the WebAudio-MediaStream 147 // This tests against crash regressions for the WebAudio-MediaStream
147 // integration. 148 // integration.
148 ASSERT_TRUE(embedded_test_server()->Start()); 149 ASSERT_TRUE(embedded_test_server()->Start());
149 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); 150 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html"));
150 ui_test_utils::NavigateToURL(browser(), url); 151 ui_test_utils::NavigateToURL(browser(), url);
151 content::WebContents* tab = 152 content::WebContents* tab =
152 browser()->tab_strip_model()->GetActiveWebContents(); 153 browser()->tab_strip_model()->GetActiveWebContents();
153 154
154 // A sleep is necessary to be able to detect the crash. 155 // A sleep is necessary to be able to detect the crash.
155 test::SleepInJavascript(tab, 1000); 156 test::SleepInJavascript(tab, 1000);
156 157
157 ASSERT_FALSE(tab->IsCrashed()); 158 ASSERT_FALSE(tab->IsCrashed());
158 } 159 }
159 160
160 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 161 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
161 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerRsa) { 162 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerRsa) {
162 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, 163 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec,
163 kKeygenAlgorithmRsa, 164 false /* prefer_hw_video_codec */,
164 kKeygenAlgorithmRsa); 165 kKeygenAlgorithmRsa, kKeygenAlgorithmRsa);
165 } 166 }
166 167
167 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 168 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
168 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerEcdsa) { 169 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerEcdsa) {
169 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, 170 RunsAudioVideoWebRTCCallInTwoTabs(
170 kKeygenAlgorithmEcdsa, 171 WebRtcTestBase::kUseDefaultVideoCodec, false /* prefer_hw_video_codec */,
171 kKeygenAlgorithmEcdsa); 172 kKeygenAlgorithmEcdsa, kKeygenAlgorithmEcdsa);
172 } 173 }
173 174
174 IN_PROC_BROWSER_TEST_F( 175 IN_PROC_BROWSER_TEST_F(
175 WebRtcBrowserTest, 176 WebRtcBrowserTest,
176 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateRsa) { 177 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateRsa) {
177 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmRsa); 178 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmRsa);
178 } 179 }
179 180
180 IN_PROC_BROWSER_TEST_F( 181 IN_PROC_BROWSER_TEST_F(
181 WebRtcBrowserTest, 182 WebRtcBrowserTest,
182 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateEcdsa) { 183 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificateEcdsa) {
183 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmEcdsa); 184 RunsAudioVideoWebRTCCallInTwoTabsWithClonedCertificate(kKeygenAlgorithmEcdsa);
184 } 185 }
185 186
186 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 187 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
187 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerEcdsa) { 188 RunsAudioVideoWebRTCCallInTwoTabsOfferRsaAnswerEcdsa) {
188 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, 189 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec,
189 kKeygenAlgorithmRsa, 190 false /* prefer_hw_video_codec */,
190 kKeygenAlgorithmEcdsa); 191 kKeygenAlgorithmRsa, kKeygenAlgorithmEcdsa);
191 } 192 }
192 193
193 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 194 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
194 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) { 195 RunsAudioVideoWebRTCCallInTwoTabsOfferEcdsaAnswerRsa) {
195 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec, 196 RunsAudioVideoWebRTCCallInTwoTabs(WebRtcTestBase::kUseDefaultVideoCodec,
196 kKeygenAlgorithmEcdsa, 197 false /* prefer_hw_video_codec */,
197 kKeygenAlgorithmRsa); 198 kKeygenAlgorithmEcdsa, kKeygenAlgorithmRsa);
198 } 199 }
199 200
200 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 201 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
201 RunsAudioVideoWebRTCCallInTwoTabsGetStatsCallback) { 202 RunsAudioVideoWebRTCCallInTwoTabsGetStatsCallback) {
202 StartServerAndOpenTabs(); 203 StartServerAndOpenTabs();
203 SetupPeerconnectionWithLocalStream(left_tab_); 204 SetupPeerconnectionWithLocalStream(left_tab_);
204 SetupPeerconnectionWithLocalStream(right_tab_); 205 SetupPeerconnectionWithLocalStream(right_tab_);
205 NegotiateCall(left_tab_, right_tab_); 206 NegotiateCall(left_tab_, right_tab_);
206 207
207 VerifyStatsGeneratedCallback(left_tab_); 208 VerifyStatsGeneratedCallback(left_tab_);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 SetupPeerconnectionWithLocalStream(left_tab_); 240 SetupPeerconnectionWithLocalStream(left_tab_);
240 SetupPeerconnectionWithLocalStream(right_tab_); 241 SetupPeerconnectionWithLocalStream(right_tab_);
241 NegotiateCall(left_tab_, right_tab_); 242 NegotiateCall(left_tab_, right_tab_);
242 243
243 std::string ice_gatheringstate = 244 std::string ice_gatheringstate =
244 ExecuteJavascript("getLastGatheringState()", left_tab_); 245 ExecuteJavascript("getLastGatheringState()", left_tab_);
245 246
246 EXPECT_EQ("complete", ice_gatheringstate); 247 EXPECT_EQ("complete", ice_gatheringstate);
247 DetectVideoAndHangUp(); 248 DetectVideoAndHangUp();
248 } 249 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698