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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "content/renderer/media/rtc_video_decoder.h" | 9 #include "content/renderer/media/rtc_video_decoder.h" |
10 #include "media/base/gmock_callback_support.h" | 10 #include "media/base/gmock_callback_support.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 idle_waiter_(false, false) { | 30 idle_waiter_(false, false) { |
31 memset(&codec_, 0, sizeof(codec_)); | 31 memset(&codec_, 0, sizeof(codec_)); |
32 } | 32 } |
33 | 33 |
34 virtual void SetUp() OVERRIDE { | 34 virtual void SetUp() OVERRIDE { |
35 ASSERT_TRUE(vda_thread_.Start()); | 35 ASSERT_TRUE(vda_thread_.Start()); |
36 vda_task_runner_ = vda_thread_.message_loop_proxy(); | 36 vda_task_runner_ = vda_thread_.message_loop_proxy(); |
37 mock_vda_ = new media::MockVideoDecodeAccelerator; | 37 mock_vda_ = new media::MockVideoDecodeAccelerator; |
38 EXPECT_CALL(*mock_gpu_factories_, GetTaskRunner()) | 38 EXPECT_CALL(*mock_gpu_factories_, GetTaskRunner()) |
39 .WillRepeatedly(Return(vda_task_runner_)); | 39 .WillRepeatedly(Return(vda_task_runner_)); |
40 EXPECT_CALL(*mock_gpu_factories_, DoCreateVideoDecodeAccelerator(_)) | 40 EXPECT_CALL(*mock_gpu_factories_, DoCreateVideoDecodeAccelerator()) |
41 .WillRepeatedly( | |
42 Return(static_cast<media::VideoDecodeAccelerator*>(NULL))); | |
43 EXPECT_CALL(*mock_gpu_factories_, | |
44 DoCreateVideoDecodeAccelerator(media::VP8PROFILE_MAIN)) | |
45 .WillRepeatedly(Return(mock_vda_)); | 41 .WillRepeatedly(Return(mock_vda_)); |
46 EXPECT_CALL(*mock_gpu_factories_, CreateSharedMemory(_)) | 42 EXPECT_CALL(*mock_gpu_factories_, CreateSharedMemory(_)) |
47 .WillRepeatedly(Return(static_cast<base::SharedMemory*>(NULL))); | 43 .WillRepeatedly(Return(static_cast<base::SharedMemory*>(NULL))); |
48 EXPECT_CALL(*mock_vda_, Initialize(_, _)) | 44 EXPECT_CALL(*mock_vda_, Initialize(_, _)) |
49 .Times(1) | 45 .Times(1) |
50 .WillRepeatedly(Return(true)); | 46 .WillRepeatedly(Return(true)); |
51 EXPECT_CALL(*mock_vda_, Destroy()).Times(1); | 47 EXPECT_CALL(*mock_vda_, Destroy()).Times(1); |
52 rtc_decoder_ = | 48 rtc_decoder_ = |
53 RTCVideoDecoder::Create(webrtc::kVideoCodecVP8, mock_gpu_factories_); | 49 RTCVideoDecoder::Create(webrtc::kVideoCodecVP8, mock_gpu_factories_); |
54 } | 50 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 204 |
209 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST, | 205 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST, |
210 RTCVideoDecoder::ID_LAST)); | 206 RTCVideoDecoder::ID_LAST)); |
211 EXPECT_TRUE( | 207 EXPECT_TRUE( |
212 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST)); | 208 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST)); |
213 EXPECT_FALSE( | 209 EXPECT_FALSE( |
214 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); | 210 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); |
215 } | 211 } |
216 | 212 |
217 } // content | 213 } // content |
OLD | NEW |