Commit 7773f988 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Parametrize VideoRendererAlgorithmTest.CadenceBasedTest

CadenceBasedTest was running the same tests for 336 combinations of
frame rate and display rate values. Replaced it with a TEST_P-based test,
so it's executed as multiple small tests which don't timeout even in
debug mode.

Bug: 767166
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: I7b9c2140cfa515c57360064fa1ebccc607bec0a8
Reviewed-on: https://chromium-review.googlesource.com/828050
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524263}
parent 6ce72d06
...@@ -1362,38 +1362,39 @@ TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesCadence) { ...@@ -1362,38 +1362,39 @@ TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesCadence) {
EXPECT_EQ(0u, EffectiveFramesQueued()); EXPECT_EQ(0u, EffectiveFramesQueued());
} }
// Test runs too slowly on debug builds. class VideoRendererAlgorithmCadenceTest
// TODO(fuchsia): Also runs too slowly on Fuchsia, this should be investigated, : public VideoRendererAlgorithmTest,
// see https://crbug.com/767166. public ::testing::WithParamInterface<::testing::tuple<double, double>> {};
#if defined(NDEBUG) && !defined(OS_FUCHSIA)
TEST_F(VideoRendererAlgorithmTest, CadenceBasedTest) { TEST_P(VideoRendererAlgorithmCadenceTest, CadenceTest) {
// Common display rates. double display_rate = std::tr1::get<0>(GetParam());
const double kDisplayRates[] = { double frame_rate = std::tr1::get<1>(GetParam());
NTSC(24), 24, NTSC(25), 25, NTSC(30), 30, 48,
NTSC(50), 50, NTSC(60), 60, 75, 120, 144, TickGenerator frame_tg(base::TimeTicks(), frame_rate);
}; TickGenerator display_tg(tick_clock_->NowTicks(), display_rate);
RunFramePumpTest(
// List of common frame rate values. Values pulled from local test media, true, &frame_tg, &display_tg,
// videostack test matrix, and Wikipedia. [](const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) {});
const double kTestRates[] = {
1, 10, 12.5, 15, NTSC(24), 24, NTSC(25), 25,
NTSC(30), 30, 30.12, 48, NTSC(50), 50, 58.74, NTSC(60),
60, 72, 90, 100, 120, 144, 240, 300,
};
for (double display_rate : kDisplayRates) {
for (double frame_rate : kTestRates) {
TickGenerator frame_tg(base::TimeTicks(), frame_rate);
TickGenerator display_tg(tick_clock_->NowTicks(), display_rate);
RunFramePumpTest(
true, &frame_tg, &display_tg,
[](const scoped_refptr<VideoFrame>& frame, size_t frames_dropped) {});
if (HasFatalFailure())
return;
}
}
} }
#endif // defined(NDEBUG) && !defined(OS_FUCHSIA)
// Common display rates.
const double kDisplayRates[] = {
NTSC(24), 24, NTSC(25), 25, NTSC(30), 30, 48,
NTSC(50), 50, NTSC(60), 60, 75, 120, 144,
};
// List of common frame rate values. Values pulled from local test media,
// videostack test matrix, and Wikipedia.
const double kTestRates[] = {
1, 10, 12.5, 15, NTSC(24), 24, NTSC(25), 25,
NTSC(30), 30, 30.12, 48, NTSC(50), 50, 58.74, NTSC(60),
60, 72, 90, 100, 120, 144, 240, 300,
};
INSTANTIATE_TEST_CASE_P(,
VideoRendererAlgorithmCadenceTest,
::testing::Combine(::testing::ValuesIn(kDisplayRates),
::testing::ValuesIn(kTestRates)));
// Rotate through various playback rates and ensure algorithm adapts correctly. // Rotate through various playback rates and ensure algorithm adapts correctly.
TEST_F(VideoRendererAlgorithmTest, VariablePlaybackRateCadence) { TEST_F(VideoRendererAlgorithmTest, VariablePlaybackRateCadence) {
......
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