Commit e517a1c2 authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Make some media_perftests TEST_P, remove/replace useless cases.

Ultimately this shaves a couple seconds of runtime off my local
build, so it should help with timeouts on Android bots.

This removes the following perf test cases since they don't
correspond to well used codecs. Well used in this case means
we see above 2% daily usage per relavant histograms:

DemuxerPerfTest:
- bear.avi
- sfx_s16le.wav
- bear.flac

AudioPipelineIntegrationPerfTest:
- sfx_f32le.wav
- sfx_s24le.wav
- sfx_u8.wav
- sfx.flac

It replaces the above audio tests with more appropriate ones
reflecting actual usage:
- sfx.mp3 (mp3)
- sfx.ogg (vorbis)
- sfx.m4a (aac)

This also splits out a couple chunk TEST() blocks into
parameterized tests for cleanliness, though that won't
improve performance since we run perf tests --single-process.

BUG=803460
TEST=none

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Iebac045d09c867eb3cc7f867d62e8959aa094e66
Reviewed-on: https://chromium-review.googlesource.com/893437
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533150}
parent af572bce
...@@ -216,24 +216,24 @@ static void RunDemuxerBenchmark(const std::string& filename) { ...@@ -216,24 +216,24 @@ static void RunDemuxerBenchmark(const std::string& filename) {
"runs/s", true); "runs/s", true);
} }
#if defined(OS_WIN) class DemuxerPerfTest : public testing::TestWithParam<const char*> {};
// http://crbug.com/399002
#define MAYBE_Demuxer DISABLED_Demuxer TEST_P(DemuxerPerfTest, Demuxer) {
#else RunDemuxerBenchmark(GetParam());
#define MAYBE_Demuxer Demuxer }
#endif
TEST(DemuxerPerfTest, MAYBE_Demuxer) { static const char* kDemuxerTestFiles[] {
RunDemuxerBenchmark("bear.ogv"); "bear.ogv", "bear-640x360.webm", "sfx.mp3",
RunDemuxerBenchmark("bear-640x360.webm");
RunDemuxerBenchmark("sfx_s16le.wav");
RunDemuxerBenchmark("bear.flac");
#if BUILDFLAG(USE_PROPRIETARY_CODECS) #if BUILDFLAG(USE_PROPRIETARY_CODECS)
RunDemuxerBenchmark("bear-1280x720.mp4"); "bear-1280x720.mp4",
RunDemuxerBenchmark("sfx.mp3");
#endif #endif
#if BUILDFLAG(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) };
RunDemuxerBenchmark("bear.avi");
#endif // For simplicity we only test containers with above 2% daily usage as measured
} // by the Media.DetectedContainer histogram.
INSTANTIATE_TEST_CASE_P(
/* no prefix */,
DemuxerPerfTest,
testing::ValuesIn(kDemuxerTestFiles));
} // namespace media } // namespace media
...@@ -38,12 +38,8 @@ static void RunPlaybackBenchmark(const std::string& filename, ...@@ -38,12 +38,8 @@ static void RunPlaybackBenchmark(const std::string& filename,
} }
} }
perf_test::PrintResult(name, perf_test::PrintResult(name, "", filename, iterations / time_seconds,
"", "runs/s", true);
filename,
iterations / time_seconds,
"runs/s",
true);
} }
static void RunVideoPlaybackBenchmark(const std::string& filename, static void RunVideoPlaybackBenchmark(const std::string& filename,
...@@ -56,17 +52,26 @@ static void RunAudioPlaybackBenchmark(const std::string& filename, ...@@ -56,17 +52,26 @@ static void RunAudioPlaybackBenchmark(const std::string& filename,
RunPlaybackBenchmark(filename, name, kBenchmarkIterationsAudio, true); RunPlaybackBenchmark(filename, name, kBenchmarkIterationsAudio, true);
} }
TEST(PipelineIntegrationPerfTest, AudioPlaybackBenchmark) { class ClocklessAudioPipelineIntegrationPerfTest
RunAudioPlaybackBenchmark("sfx_f32le.wav", "clockless_playback"); : public testing::TestWithParam<const char*> {};
RunAudioPlaybackBenchmark("sfx_s24le.wav", "clockless_playback");
RunAudioPlaybackBenchmark("sfx_s16le.wav", "clockless_playback"); TEST_P(ClocklessAudioPipelineIntegrationPerfTest, PlaybackBenchmark) {
RunAudioPlaybackBenchmark("sfx_u8.wav", "clockless_playback"); RunAudioPlaybackBenchmark(GetParam(), "clockless_playback");
RunAudioPlaybackBenchmark("sfx.flac", "clockless_playback"); }
static const char* kAudioTestFiles[] {
"sfx_s16le.wav", "sfx.ogg", "sfx.mp3",
#if BUILDFLAG(USE_PROPRIETARY_CODECS) #if BUILDFLAG(USE_PROPRIETARY_CODECS)
RunAudioPlaybackBenchmark("sfx.mp3", "clockless_playback"); "sfx.m4a",
RunAudioPlaybackBenchmark("sfx-flac.mp4", "clockless_playback");
#endif #endif
} };
// For simplicity we only test codecs with above 2% daily usage as measured by
// the Media.AudioCodec histogram.
INSTANTIATE_TEST_CASE_P(
/* no prefix */,
ClocklessAudioPipelineIntegrationPerfTest,
testing::ValuesIn(kAudioTestFiles));
TEST(PipelineIntegrationPerfTest, VP8PlaybackBenchmark) { TEST(PipelineIntegrationPerfTest, VP8PlaybackBenchmark) {
RunVideoPlaybackBenchmark("bear_silent.webm", "clockless_video_playback_vp8"); RunVideoPlaybackBenchmark("bear_silent.webm", "clockless_video_playback_vp8");
...@@ -76,16 +81,7 @@ TEST(PipelineIntegrationPerfTest, VP9PlaybackBenchmark) { ...@@ -76,16 +81,7 @@ TEST(PipelineIntegrationPerfTest, VP9PlaybackBenchmark) {
RunVideoPlaybackBenchmark("bear-vp9.webm", "clockless_video_playback_vp9"); RunVideoPlaybackBenchmark("bear-vp9.webm", "clockless_video_playback_vp9");
} }
// Android doesn't build Theora support. #if BUILDFLAG(USE_PROPRIETARY_CODECS) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
#if !defined(OS_ANDROID)
TEST(PipelineIntegrationPerfTest, TheoraPlaybackBenchmark) {
RunVideoPlaybackBenchmark("bear_silent.ogv",
"clockless_video_playback_theora");
}
#endif
// PipelineIntegrationTests can't play h264 content.
#if BUILDFLAG(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID)
TEST(PipelineIntegrationPerfTest, MP4PlaybackBenchmark) { TEST(PipelineIntegrationPerfTest, MP4PlaybackBenchmark) {
RunVideoPlaybackBenchmark("bear_silent.mp4", "clockless_video_playback_mp4"); RunVideoPlaybackBenchmark("bear_silent.mp4", "clockless_video_playback_mp4");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment