Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: media/gpu/video_encode_accelerator_unittest.cc

Issue 2573733002: VEA unittest: fix TestSimpleEncode crash while decoder fails (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/video_encode_accelerator_unittest.cc
diff --git a/media/gpu/video_encode_accelerator_unittest.cc b/media/gpu/video_encode_accelerator_unittest.cc
index 9d9f5a4844ace3091fb5e3bb68c76bef3349f680..0efc27feb815f272c21cb759ef5373c461f74e86 100644
--- a/media/gpu/video_encode_accelerator_unittest.cc
+++ b/media/gpu/video_encode_accelerator_unittest.cc
@@ -2074,9 +2074,16 @@ TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
// encoders are created/destroyed, is a single GPU Process ChildThread.
// Moreover, we can't have proper multithreading on X11, so this could cause
// hard to debug issues there, if there were multiple "ChildThreads".
+ bool wrong_state = false;
for (const auto& state : state_transitions) {
- for (size_t i = 0; i < num_concurrent_encoders; i++)
- ASSERT_EQ(state, notes[i]->Wait());
+ for (size_t i = 0; i < num_concurrent_encoders && !wrong_state; i++) {
+ ClientState wait_state = notes[i]->Wait();
+ EXPECT_EQ(state, wait_state);
+ wrong_state = (state != wait_state);
+ }
+ if (wrong_state) {
wuchengli 2016/12/13 09:18:32 Can we use if (HasFailure())? Same for line 2079.
+ break;
+ }
}
for (size_t i = 0; i < num_concurrent_encoders; ++i) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698