#include "base/command_line.h"
#include "build/build_config.h"
#include "content/browser/media/media_browsertest.h"
#include "content/public/test/browser_test.h"
#include "media/base/media_switches.h"
#include "media/base/supported_types.h"
#include "media/base/test_data_util.h"
#include "media/media_buildflags.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
namespace content {
class MediaSourceTest : public MediaBrowserTest { … };
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoAudio_WebM) { … }
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoOnly_WebM) { … }
#if BUILDFLAG(USE_PROPRIETARY_CODECS) && !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_AAC_ADTS) {
TestSimplePlayback("sfx.adts", media::kEndedTitle);
}
#endif
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_Opus_WebM) { … }
#endif
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_WebM) { … }
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_MP3) { … }
IN_PROC_BROWSER_TEST_F(
MediaSourceTest,
Playback_AudioOnly_MP3_With_Codecs_Parameter_Should_Fail) { … }
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_ConfigChangeVideo …
#else
#define MAYBE_ConfigChangeVideo …
#endif
IN_PROC_BROWSER_TEST_F(MediaSourceTest, MAYBE_ConfigChangeVideo) { … }
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) {
auto query_params = GetAudioVideoQueryParams("bear-320x240-audio-only.webm",
"bear-640x360-v_frag.mp4");
RunMediaTestPage("mse_different_containers.html", std::move(query_params),
media::kEndedTitle, true);
}
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_WEBM_Audio_MP4) {
auto query_params = GetAudioVideoQueryParams("bear-640x360-a_frag.mp4",
"bear-320x240-video-only.webm");
RunMediaTestPage("mse_different_containers.html", std::move(query_params),
media::kEndedTitle, true);
}
#endif
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_FLAC_MP4) { … }
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_XHE_AAC_MP4) { … }
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
#if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER)
IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioVideo_Mp2t) {
TestSimplePlayback("bear-1280x720.ts", media::kEndedTitle);
}
#endif
#endif
}