#include <string>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/media/webrtc/test_stats_dictionary.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_common.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "media/base/media_switches.h"
#include "testing/perf/perf_test.h"
#include "third_party/blink/public/common/features.h"
namespace content {
namespace {
const char kMainWebrtcTestHtmlPage[] = …;
const char kInboundRtp[] = …;
const char kOutboundRtp[] = …;
double GetTotalRTPStreamBytes(
TestStatsReportDictionary* report, const char* type,
const char* media_type) { … }
double GetAudioBytesSent(TestStatsReportDictionary* report) { … }
double GetAudioBytesReceived(TestStatsReportDictionary* report) { … }
double GetVideoBytesSent(TestStatsReportDictionary* report) { … }
double GetVideoBytesReceived(TestStatsReportDictionary* report) { … }
class WebRtcStatsPerfBrowserTest : public WebRtcTestBase { … };
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_opus) { … }
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_G722) { … }
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMU) { … }
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_AudioCodec_PCMA) { … }
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP8) { … }
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9Profile2 …
#else
#define MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9Profile2 …
#endif
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_VP9Profile2) { … }
#if BUILDFLAG(RTC_USE_H264)
#if BUILDFLAG(IS_MAC)
#define MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264 …
#else
#define MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264 …
#endif
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MAYBE_MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_H264) {
base::ScopedAllowBlockingForTesting allow_blocking;
if (!base::FeatureList::IsEnabled(
blink::features::kWebRtcH264WithOpenH264FFmpeg)) {
LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
"Skipping WebRtcPerfBrowserTest."
"MANUAL_RunsAudioAndVideoCallCollectingMetrics_VideoCodec_"
"H264 (test "
"\"OK\")";
return;
}
RunsAudioAndVideoCallCollectingMetricsWithVideoCodec(
"H264", true );
}
#endif
IN_PROC_BROWSER_TEST_F(
WebRtcStatsPerfBrowserTest,
MANUAL_RunsAudioAndVideoCallMeasuringGetStatsPerformance_Promise) { … }
}
}