OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // TODO(wuchengli): add MockSharedMemory so more functions can be tested. | 43 // TODO(wuchengli): add MockSharedMemory so more functions can be tested. |
44 class RTCVideoDecoderTest | 44 class RTCVideoDecoderTest |
45 : public ::testing::TestWithParam<webrtc::VideoCodecType>, | 45 : public ::testing::TestWithParam<webrtc::VideoCodecType>, |
46 webrtc::DecodedImageCallback { | 46 webrtc::DecodedImageCallback { |
47 public: | 47 public: |
48 RTCVideoDecoderTest() | 48 RTCVideoDecoderTest() |
49 : mock_gpu_factories_( | 49 : mock_gpu_factories_( |
50 new media::MockGpuVideoAcceleratorFactories(nullptr)), | 50 new media::MockGpuVideoAcceleratorFactories(nullptr)), |
51 vda_thread_("vda_thread"), | 51 vda_thread_("vda_thread"), |
52 idle_waiter_(false, false) { | 52 idle_waiter_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 53 base::WaitableEvent::InitialState::NOT_SIGNALED) { |
53 memset(&codec_, 0, sizeof(codec_)); | 54 memset(&codec_, 0, sizeof(codec_)); |
54 } | 55 } |
55 | 56 |
56 void SetUp() override { | 57 void SetUp() override { |
57 ASSERT_TRUE(vda_thread_.Start()); | 58 ASSERT_TRUE(vda_thread_.Start()); |
58 vda_task_runner_ = vda_thread_.task_runner(); | 59 vda_task_runner_ = vda_thread_.task_runner(); |
59 mock_vda_ = new media::MockVideoDecodeAccelerator; | 60 mock_vda_ = new media::MockVideoDecodeAccelerator; |
60 | 61 |
61 media::VideoDecodeAccelerator::SupportedProfile supported_profile; | 62 media::VideoDecodeAccelerator::SupportedProfile supported_profile; |
62 supported_profile.min_resolution.SetSize(kMinResolutionWidth, | 63 supported_profile.min_resolution.SetSize(kMinResolutionWidth, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 10)); | 319 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 10)); |
319 EXPECT_EQ(0, rtc_decoder_->GetVDAErrorCounterForTesting()); | 320 EXPECT_EQ(0, rtc_decoder_->GetVDAErrorCounterForTesting()); |
320 } | 321 } |
321 | 322 |
322 INSTANTIATE_TEST_CASE_P(CodecProfiles, | 323 INSTANTIATE_TEST_CASE_P(CodecProfiles, |
323 RTCVideoDecoderTest, | 324 RTCVideoDecoderTest, |
324 Values(webrtc::kVideoCodecVP8, | 325 Values(webrtc::kVideoCodecVP8, |
325 webrtc::kVideoCodecH264)); | 326 webrtc::kVideoCodecH264)); |
326 | 327 |
327 } // content | 328 } // content |
OLD | NEW |