#include "base/command_line.h"
#include "base/strings/stringprintf.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/public/test/content_browser_test_utils.h"
#include "media/base/media_switches.h"
namespace {
static const char kMediaRecorderHtmlFile[] = …;
static struct EncodingParameters { … } const kEncodingParameters[] = …;
static const EncodingParameters kProprietaryEncodingParameters[] = …;
}
namespace content {
class WebRtcMediaRecorderTest
: public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<struct EncodingParameters> { … };
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_Start …
#else
#define MAYBE_Start …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_Start) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, StartAndStop) { … }
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
#define MAYBE_StartAndDataAvailable …
#else
#define MAYBE_StartAndDataAvailable …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_StartAndDataAvailable) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StartWithTimeSlice …
#else
#define MAYBE_StartWithTimeSlice …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_StartWithTimeSlice) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, Resume) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, NoResumeWhenRecorderInactive) { … }
#if (BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)) || BUILDFLAG(IS_ANDROID)
#define MAYBE_ResumeAndDataAvailable …
#else
#define MAYBE_ResumeAndDataAvailable …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_ResumeAndDataAvailable) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, Pause) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_PauseStop …
#else
#define MAYBE_PauseStop …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_PauseStop) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
PausePreventsDataavailableFromBeingFired) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_IllegalPauseThrowsDOMError …
#else
#define MAYBE_IllegalPauseThrowsDOMError …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
MAYBE_IllegalPauseThrowsDOMError) { … }
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
#define MAYBE_TwoChannelAudioRecording …
#else
#define MAYBE_TwoChannelAudioRecording …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
MAYBE_TwoChannelAudioRecording) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, RecordWithTransparency) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
IllegalStartWhileRecordingThrowsDOMError) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
IllegalStartWhilePausedThrowsDOMError) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_IllegalRequestDataThrowsDOMError …
#else
#define MAYBE_IllegalRequestDataThrowsDOMError …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
MAYBE_IllegalRequestDataThrowsDOMError) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_PeerConnection …
#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
defined(THREAD_SANITIZER)
#define MAYBE_PeerConnection …
#elif BUILDFLAG(IS_WIN) && !defined(NDEBUG)
#define MAYBE_PeerConnection …
#elif BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
#define MAYBE_PeerConnection …
#elif BUILDFLAG(IS_FUCHSIA) && defined(ARCH_CPU_X86_64)
#define MAYBE_PeerConnection …
#else
#define MAYBE_PeerConnection …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest, MAYBE_PeerConnection) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_AddingTrackToMediaStreamFiresErrorEvent …
#elif BUILDFLAG(IS_ANDROID)
#define MAYBE_AddingTrackToMediaStreamFiresErrorEvent …
#else
#define MAYBE_AddingTrackToMediaStreamFiresErrorEvent …
#endif
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
MAYBE_AddingTrackToMediaStreamFiresErrorEvent) { … }
IN_PROC_BROWSER_TEST_P(WebRtcMediaRecorderTest,
RemovingTrackFromMediaStreamFiresErrorEvent) { … }
INSTANTIATE_TEST_SUITE_P(…);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
INSTANTIATE_TEST_SUITE_P(ProprietaryCodec,
WebRtcMediaRecorderTest,
testing::ValuesIn(kProprietaryEncodingParameters));
#endif
}