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

Side by Side Diff: media/cast/receiver/video_decoder_unittest.cc

Issue 436673004: Fix flaky cast_unittests where threads were being joined incorrectly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cstdlib> 5 #include <cstdlib>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/synchronization/condition_variable.h" 9 #include "base/synchronization/condition_variable.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 26 matching lines...) Expand all
37 37
38 class VideoDecoderTest : public ::testing::TestWithParam<Codec> { 38 class VideoDecoderTest : public ::testing::TestWithParam<Codec> {
39 public: 39 public:
40 VideoDecoderTest() 40 VideoDecoderTest()
41 : cast_environment_(new StandaloneCastEnvironment()), 41 : cast_environment_(new StandaloneCastEnvironment()),
42 vp8_encoder_(GetVideoSenderConfigForTest(), 0), 42 vp8_encoder_(GetVideoSenderConfigForTest(), 0),
43 cond_(&lock_) { 43 cond_(&lock_) {
44 vp8_encoder_.Initialize(); 44 vp8_encoder_.Initialize();
45 } 45 }
46 46
47 virtual ~VideoDecoderTest() {
48 // Make sure all threads have stopped before the environment goes away.
49 cast_environment_->Shutdown();
50 }
51
47 protected: 52 protected:
48 virtual void SetUp() OVERRIDE { 53 virtual void SetUp() OVERRIDE {
49 video_decoder_.reset(new VideoDecoder(cast_environment_, GetParam())); 54 video_decoder_.reset(new VideoDecoder(cast_environment_, GetParam()));
50 CHECK_EQ(STATUS_VIDEO_INITIALIZED, video_decoder_->InitializationResult()); 55 CHECK_EQ(STATUS_VIDEO_INITIALIZED, video_decoder_->InitializationResult());
51 56
52 next_frame_timestamp_ = base::TimeDelta(); 57 next_frame_timestamp_ = base::TimeDelta();
53 last_frame_id_ = 0; 58 last_frame_id_ = 0;
54 seen_a_decoded_frame_ = false; 59 seen_a_decoded_frame_ = false;
55 60
56 total_video_frames_feed_in_ = 0; 61 total_video_frames_feed_in_ = 0;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 179 }
175 WaitForAllVideoToBeDecoded(); 180 WaitForAllVideoToBeDecoded();
176 } 181 }
177 182
178 INSTANTIATE_TEST_CASE_P(VideoDecoderTestScenarios, 183 INSTANTIATE_TEST_CASE_P(VideoDecoderTestScenarios,
179 VideoDecoderTest, 184 VideoDecoderTest,
180 ::testing::Values(CODEC_VIDEO_VP8)); 185 ::testing::Values(CODEC_VIDEO_VP8));
181 186
182 } // namespace cast 187 } // namespace cast
183 } // namespace media 188 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/receiver/audio_decoder_unittest.cc ('k') | media/cast/test/utility/standalone_cast_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698