OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |