#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include "base/base64.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.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/webrtc_browsertest_base.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_common.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_perf.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "media/base/media_switches.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/python_utils.h"
#include "testing/perf/perf_test.h"
#include "third_party/blink/public/common/features.h"
#include "ui/gl/gl_switches.h"
namespace {
std::string MakeLabel(const char* test_name, const std::string& video_codec) { … }
}
static const base::FilePath::CharType kFrameAnalyzerExecutable[] = …FILE_PATH_LITERAL("frame_analyzer.exe");
#else
FILE_PATH_LITERAL("frame_analyzer");
#endif
static const base::FilePath::CharType kCapturedYuvFileName[] = …);
static const base::FilePath::CharType kCapturedWebmFileName[] = …);
static const char kMainWebrtcTestHtmlPage[] = …;
static const char kCapturingWebrtcHtmlPage[] = …;
static const struct VideoQualityTestConfig { … } kVideoConfigurations[] = …;
class WebRtcVideoQualityBrowserTest : public WebRtcTestBase,
public testing::WithParamInterface<VideoQualityTestConfig> { … };
INSTANTIATE_TEST_SUITE_P(…);
#if defined(COMPONENT_BUILD)
#define MAYBE_MANUAL_TestVideoQualityVp8 …
#else
#define MAYBE_MANUAL_TestVideoQualityVp8 …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcVideoQualityBrowserTest,
MAYBE_MANUAL_TestVideoQualityVp8) { … }
#if BUILDFLAG(IS_WIN) || defined(COMPONENT_BUILD)
#define MAYBE_MANUAL_TestVideoQualityVp9 …
#else
#define MAYBE_MANUAL_TestVideoQualityVp9 …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcVideoQualityBrowserTest,
MAYBE_MANUAL_TestVideoQualityVp9) { … }
#if BUILDFLAG(RTC_USE_H264)
#if BUILDFLAG(IS_MAC) || defined(COMPONENT_BUILD)
#define MAYBE_MANUAL_TestVideoQualityH264 …
#else
#define MAYBE_MANUAL_TestVideoQualityH264 …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcVideoQualityBrowserTest,
MAYBE_MANUAL_TestVideoQualityH264) {
base::ScopedAllowBlockingForTesting allow_blocking;
if (!base::FeatureList::IsEnabled(
blink::features::kWebRtcH264WithOpenH264FFmpeg)) {
LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
"Skipping WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264 "
"(test \"OK\")";
return;
}
TestVideoQuality("H264", true );
}
#endif