| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "media/base/data_buffer.h" | 7 #include "media/base/data_buffer.h" |
| 8 #include "media/base/mock_task.h" | 8 #include "media/base/mock_task.h" |
| 9 #include "media/base/pipeline.h" | 9 #include "media/base/pipeline.h" |
| 10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngineTest); | 144 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngineTest); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_Normal) { | 147 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_Normal) { |
| 148 Initialize(); | 148 Initialize(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_FindDecoderFails) { | 151 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_FindDecoderFails) { |
| 152 VideoDecoderConfig config(kUnknown, kCodedSize, kVisibleRect, kNaturalSize, | 152 VideoDecoderConfig config(kUnknownVideoCodec, kCodedSize, kVisibleRect, |
| 153 kFrameRate.num, kFrameRate.den, NULL, 0); | 153 kNaturalSize, kFrameRate.num, kFrameRate.den, |
| 154 NULL, 0); |
| 155 |
| 154 // Test avcodec_find_decoder() returning NULL. | 156 // Test avcodec_find_decoder() returning NULL. |
| 155 VideoCodecInfo info; | 157 VideoCodecInfo info; |
| 156 EXPECT_CALL(*this, OnInitializeComplete(_)) | 158 EXPECT_CALL(*this, OnInitializeComplete(_)) |
| 157 .WillOnce(SaveArg<0>(&info)); | 159 .WillOnce(SaveArg<0>(&info)); |
| 158 test_engine_->Initialize(MessageLoop::current(), this, NULL, config); | 160 test_engine_->Initialize(MessageLoop::current(), this, NULL, config); |
| 159 EXPECT_FALSE(info.success); | 161 EXPECT_FALSE(info.success); |
| 160 } | 162 } |
| 161 | 163 |
| 162 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_OpenDecoderFails) { | 164 TEST_F(FFmpegVideoDecodeEngineTest, Initialize_OpenDecoderFails) { |
| 163 // Specify Theora w/o extra data so that avcodec_open() fails. | 165 // Specify Theora w/o extra data so that avcodec_open() fails. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // DecodeIFrameThenTestFile("vp8-I-frame-320x480"); | 276 // DecodeIFrameThenTestFile("vp8-I-frame-320x480"); |
| 275 //} | 277 //} |
| 276 | 278 |
| 277 // Decode |i_frame_buffer_| and then a frame with a smaller height and verify | 279 // Decode |i_frame_buffer_| and then a frame with a smaller height and verify |
| 278 // the output size didn't change. | 280 // the output size didn't change. |
| 279 TEST_F(FFmpegVideoDecodeEngineTest, DecodeFrame_SmallerHeight) { | 281 TEST_F(FFmpegVideoDecodeEngineTest, DecodeFrame_SmallerHeight) { |
| 280 DecodeIFrameThenTestFile("vp8-I-frame-320x120"); | 282 DecodeIFrameThenTestFile("vp8-I-frame-320x120"); |
| 281 } | 283 } |
| 282 | 284 |
| 283 } // namespace media | 285 } // namespace media |
| OLD | NEW |