Commit 2f0b41a9 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/vea_tests: Set longer event timeout in Bitrate test

There are a few failures due to the timeout of waiting during
BitrateCheck test. This CL increase the event timeout in the
test case as well as in DynamicFramerate/Bitratechange tests.

Bug: b:170790027
Test: None
Change-Id: If77dd5f645af0d9ea9edf19eb3271c6dfaf47770
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517236
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarDavid Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824287}
parent 2e9e8d8d
...@@ -89,6 +89,10 @@ constexpr base::FilePath::CharType kDefaultTestVideoPath[] = ...@@ -89,6 +89,10 @@ constexpr base::FilePath::CharType kDefaultTestVideoPath[] =
constexpr size_t kNumFramesToEncodeForBitrateCheck = 300; constexpr size_t kNumFramesToEncodeForBitrateCheck = 300;
// Tolerance factor for how encoded bitrate can differ from requested bitrate. // Tolerance factor for how encoded bitrate can differ from requested bitrate.
constexpr double kBitrateTolerance = 0.1; constexpr double kBitrateTolerance = 0.1;
// The event timeout used in bitrate check tests because encoding 2160p and
// validating |kNumFramesToEncodeBitrateCheck| frames take much time.
constexpr base::TimeDelta kBitrateCheckEventTimeout =
base::TimeDelta::FromSeconds(180);
media::test::VideoEncoderTestEnvironment* g_env; media::test::VideoEncoderTestEnvironment* g_env;
...@@ -298,6 +302,9 @@ TEST_F(VideoEncoderTest, BitrateCheck) { ...@@ -298,6 +302,9 @@ TEST_F(VideoEncoderTest, BitrateCheck) {
auto config = GetDefaultConfig(); auto config = GetDefaultConfig();
config.num_frames_to_encode = kNumFramesToEncodeForBitrateCheck; config.num_frames_to_encode = kNumFramesToEncodeForBitrateCheck;
auto encoder = CreateVideoEncoder(g_env->Video(), config); auto encoder = CreateVideoEncoder(g_env->Video(), config);
// Set longer event timeout than the default (30 sec) because encoding 2160p
// and validating the stream take much time.
encoder->SetEventWaitTimeout(kBitrateCheckEventTimeout);
encoder->Encode(); encoder->Encode();
EXPECT_TRUE(encoder->WaitForFlushDone()); EXPECT_TRUE(encoder->WaitForFlushDone());
...@@ -315,7 +322,7 @@ TEST_F(VideoEncoderTest, DynamicBitrateChange) { ...@@ -315,7 +322,7 @@ TEST_F(VideoEncoderTest, DynamicBitrateChange) {
auto encoder = CreateVideoEncoder(g_env->Video(), config); auto encoder = CreateVideoEncoder(g_env->Video(), config);
// Set longer event timeout than the default (30 sec) because encoding 2160p // Set longer event timeout than the default (30 sec) because encoding 2160p
// and validating the stream take much time. // and validating the stream take much time.
encoder->SetEventWaitTimeout(base::TimeDelta::FromSeconds(180)); encoder->SetEventWaitTimeout(kBitrateCheckEventTimeout);
// Encode the video with the first bitrate. // Encode the video with the first bitrate.
const uint32_t first_bitrate = config.bitrate; const uint32_t first_bitrate = config.bitrate;
...@@ -346,7 +353,7 @@ TEST_F(VideoEncoderTest, DynamicFramerateChange) { ...@@ -346,7 +353,7 @@ TEST_F(VideoEncoderTest, DynamicFramerateChange) {
auto encoder = CreateVideoEncoder(g_env->Video(), config); auto encoder = CreateVideoEncoder(g_env->Video(), config);
// Set longer event timeout than the default (30 sec) because encoding 2160p // Set longer event timeout than the default (30 sec) because encoding 2160p
// and validating the stream take much time. // and validating the stream take much time.
encoder->SetEventWaitTimeout(base::TimeDelta::FromSeconds(180)); encoder->SetEventWaitTimeout(kBitrateCheckEventTimeout);
// Encode the video with the first framerate. // Encode the video with the first framerate.
const uint32_t first_framerate = config.framerate; const uint32_t first_framerate = config.framerate;
......
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