| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorOnMissingFrames) { | 161 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorOnMissingFrames) { |
| 162 CreateDecoder(webrtc::kVideoCodecVP8); | 162 CreateDecoder(webrtc::kVideoCodecVP8); |
| 163 Initialize(); | 163 Initialize(); |
| 164 webrtc::EncodedImage input_image; | 164 webrtc::EncodedImage input_image; |
| 165 input_image._completeFrame = true; | 165 input_image._completeFrame = true; |
| 166 bool missingFrames = true; | 166 bool missingFrames = true; |
| 167 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, | 167 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, |
| 168 rtc_decoder_->Decode(input_image, missingFrames, NULL, NULL, 0)); | 168 rtc_decoder_->Decode(input_image, missingFrames, NULL, NULL, 0)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 TEST_F(RTCVideoDecoderTest, ResetReturnsOk) { | |
| 172 CreateDecoder(webrtc::kVideoCodecVP8); | |
| 173 Initialize(); | |
| 174 EXPECT_CALL(*mock_vda_, Reset()) | |
| 175 .WillOnce(Invoke(this, &RTCVideoDecoderTest::NotifyResetDone)); | |
| 176 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->Reset()); | |
| 177 } | |
| 178 | |
| 179 TEST_F(RTCVideoDecoderTest, ReleaseReturnsOk) { | 171 TEST_F(RTCVideoDecoderTest, ReleaseReturnsOk) { |
| 180 CreateDecoder(webrtc::kVideoCodecVP8); | 172 CreateDecoder(webrtc::kVideoCodecVP8); |
| 181 Initialize(); | 173 Initialize(); |
| 182 EXPECT_CALL(*mock_vda_, Reset()) | 174 EXPECT_CALL(*mock_vda_, Reset()) |
| 183 .WillOnce(Invoke(this, &RTCVideoDecoderTest::NotifyResetDone)); | 175 .WillOnce(Invoke(this, &RTCVideoDecoderTest::NotifyResetDone)); |
| 184 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->Release()); | 176 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->Release()); |
| 185 } | 177 } |
| 186 | 178 |
| 187 TEST_F(RTCVideoDecoderTest, InitDecodeAfterRelease) { | 179 TEST_F(RTCVideoDecoderTest, InitDecodeAfterRelease) { |
| 188 CreateDecoder(webrtc::kVideoCodecVP8); | 180 CreateDecoder(webrtc::kVideoCodecVP8); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 231 |
| 240 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST, | 232 EXPECT_FALSE(rtc_decoder_->IsFirstBufferAfterReset(RTCVideoDecoder::ID_LAST, |
| 241 RTCVideoDecoder::ID_LAST)); | 233 RTCVideoDecoder::ID_LAST)); |
| 242 EXPECT_TRUE( | 234 EXPECT_TRUE( |
| 243 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST)); | 235 rtc_decoder_->IsFirstBufferAfterReset(0, RTCVideoDecoder::ID_LAST)); |
| 244 EXPECT_FALSE( | 236 EXPECT_FALSE( |
| 245 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); | 237 rtc_decoder_->IsFirstBufferAfterReset(1, RTCVideoDecoder::ID_LAST)); |
| 246 } | 238 } |
| 247 | 239 |
| 248 } // content | 240 } // content |
| OLD | NEW |