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

Unified Diff: chrome/browser/media/webrtc/webrtc_stats_perf_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/webrtc/webrtc_stats_perf_browsertest.cc
diff --git a/chrome/browser/media/webrtc/webrtc_stats_perf_browsertest.cc b/chrome/browser/media/webrtc/webrtc_stats_perf_browsertest.cc
index c393a760736fe96a59cf2cf3b9da7221f40dfc45..cd28721716da2ce9d84433127c31edeaee59d0eb 100644
--- a/chrome/browser/media/webrtc/webrtc_stats_perf_browsertest.cc
+++ b/chrome/browser/media/webrtc/webrtc_stats_perf_browsertest.cc
@@ -88,7 +88,8 @@ class WebRtcStatsPerfBrowserTest : public WebRtcTestBase {
}
void StartCall(const std::string& audio_codec,
- const std::string& video_codec) {
+ const std::string& video_codec,
+ bool prefer_hw_video_codec) {
ASSERT_TRUE(test::HasReferenceFilesInCheckout());
ASSERT_TRUE(embedded_test_server()->Start());
@@ -103,8 +104,8 @@ class WebRtcStatsPerfBrowserTest : public WebRtcTestBase {
SetupPeerconnectionWithLocalStream(right_tab_);
SetDefaultAudioCodec(left_tab_, audio_codec);
SetDefaultAudioCodec(right_tab_, audio_codec);
- SetDefaultVideoCodec(left_tab_, video_codec);
- SetDefaultVideoCodec(right_tab_, video_codec);
+ SetDefaultVideoCodec(left_tab_, video_codec, prefer_hw_video_codec);
+ SetDefaultVideoCodec(right_tab_, video_codec, prefer_hw_video_codec);
CreateDataChannel(left_tab_, "data");
CreateDataChannel(right_tab_, "data");
NegotiateCall(left_tab_, right_tab_);
@@ -121,9 +122,23 @@ class WebRtcStatsPerfBrowserTest : public WebRtcTestBase {
HangUp(right_tab_);
}
- void RunsAudioAndVideoCallCollectingMetrics(
- const std::string& audio_codec, const std::string& video_codec) {
- StartCall(audio_codec, video_codec);
+ void RunsAudioAndVideoCallCollectingMetricsWithAudioCodec(
+ const std::string& audio_codec) {
+ RunsAudioAndVideoCallCollectingMetrics(audio_codec, kUseDefaultVideoCodec,
+ false /* prefer_hw_video_codec */);
+ }
+
+ void RunsAudioAndVideoCallCollectingMetricsWithVideoCodec(
+ const std::string& video_codec,
+ bool prefer_hw_video_codec) {
+ RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, video_codec,
+ prefer_hw_video_codec);
+ }
+
+ void RunsAudioAndVideoCallCollectingMetrics(const std::string& audio_codec,
+ const std::string& video_codec,
+ bool prefer_hw_video_codec) {
+ StartCall(audio_codec, video_codec, prefer_hw_video_codec);
// Call for 60 seconds so that values may stabilize, bandwidth ramp up, etc.
test::SleepInJavascript(left_tab_, 60000);
@@ -199,7 +214,8 @@ class WebRtcStatsPerfBrowserTest : public WebRtcTestBase {
GetStatsVariation variation) {
EXPECT_TRUE(base::TimeTicks::IsHighResolution());
- StartCall(kUseDefaultAudioCodec, kUseDefaultVideoCodec);
+ StartCall(kUseDefaultAudioCodec, kUseDefaultVideoCodec,
+ false /* prefer_hw_video_codec */);
double invocation_time = 0.0;
switch (variation) {
@@ -234,49 +250,51 @@ IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_opus) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics("opus", kUseDefaultVideoCodec);
+ RunsAudioAndVideoCallCollectingMetricsWithAudioCodec("opus");
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_ISAC) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics("ISAC", kUseDefaultVideoCodec);
+ RunsAudioAndVideoCallCollectingMetricsWithAudioCodec("ISAC");
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_G722) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics("G722", kUseDefaultVideoCodec);
+ RunsAudioAndVideoCallCollectingMetricsWithAudioCodec("G722");
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMU) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics("PCMU", kUseDefaultVideoCodec);
+ RunsAudioAndVideoCallCollectingMetricsWithAudioCodec("PCMU");
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMA) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics("PCMA", kUseDefaultVideoCodec);
+ RunsAudioAndVideoCallCollectingMetricsWithAudioCodec("PCMA");
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP8) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP8");
+ RunsAudioAndVideoCallCollectingMetricsWithVideoCodec(
+ "VP8", false /* prefer_hw_video_codec */);
}
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "VP9");
+ RunsAudioAndVideoCallCollectingMetricsWithVideoCodec(
+ "VP9", false /* prefer_hw_video_codec */);
}
#if BUILDFLAG(RTC_USE_H264)
@@ -293,7 +311,8 @@ IN_PROC_BROWSER_TEST_F(
"\"OK\")";
return;
}
- RunsAudioAndVideoCallCollectingMetrics(kUseDefaultAudioCodec, "H264");
+ RunsAudioAndVideoCallCollectingMetricsWithVideoCodec(
+ "H264", true /* prefer_hw_video_codec */);
}
#endif // BUILDFLAG(RTC_USE_H264)

Powered by Google App Engine
This is Rietveld 408576698