#include "base/command_line.h"
#include "build/build_config.h"
#include "content/browser/webrtc/webrtc_content_browsertest_base.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/shell/common/shell_switches.h"
#include "media/base/media_switches.h"
#include "media/base/test_data_util.h"
#include "media/mojo/buildflags.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#include "base/system/sys_info.h"
#endif
#if BUILDFLAG(ENABLE_MOJO_RENDERER)
#define MAYBE_CaptureFromMediaElement …
#else
#define MAYBE_CaptureFromMediaElement …
#endif
namespace {
static const char kCanvasCaptureTestHtmlFile[] = …;
static const char kCanvasCaptureColorTestHtmlFile[] = …;
static const char kVideoAudioHtmlFile[] = …;
static struct FileAndTypeParameters { … } const kFileAndTypeParameters[] = …;
}
namespace content {
class WebRtcCaptureFromElementBrowserTest
: public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<struct FileAndTypeParameters> { … };
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
VerifyCanvas2DCaptureColor) { … }
#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_ARM64)
#define MAYBE_VerifyCanvasWebGLCaptureOpaqueColor …
#else
#define MAYBE_VerifyCanvasWebGLCaptureOpaqueColor …
#endif
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
MAYBE_VerifyCanvasWebGLCaptureOpaqueColor) { … }
#if BUILDFLAG(IS_WIN) && defined(ARCH_CPU_ARM64)
#define MAYBE_VerifyCanvasWebGLCaptureAlphaColor …
#else
#define MAYBE_VerifyCanvasWebGLCaptureAlphaColor …
#endif
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
MAYBE_VerifyCanvasWebGLCaptureAlphaColor) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
#define MAYBE_VerifyCanvasCapture2DFrames …
#else
#define MAYBE_VerifyCanvasCapture2DFrames …
#endif
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
MAYBE_VerifyCanvasCapture2DFrames) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#define MAYBE_VerifyCanvasCaptureWebGLFrames …
#else
#define MAYBE_VerifyCanvasCaptureWebGLFrames …
#endif
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
MAYBE_VerifyCanvasCaptureWebGLFrames) { … }
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
DISABLED_VerifyCanvasCaptureOffscreenCanvasFrames) { … }
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
DISABLED_VerifyCanvasCaptureBitmapRendererFrames) { … }
IN_PROC_BROWSER_TEST_P(WebRtcCaptureFromElementBrowserTest,
MAYBE_CaptureFromMediaElement) { … }
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
DISABLED_CaptureFromCanvas2DHandlesContextLoss) { … }
IN_PROC_BROWSER_TEST_F(WebRtcCaptureFromElementBrowserTest,
DISABLED_CaptureFromOpaqueCanvas2DHandlesContextLoss) { … }
INSTANTIATE_TEST_SUITE_P(…);
}