OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 scoped_refptr<VideoFrame> end_of_stream_video_frame_; | 247 scoped_refptr<VideoFrame> end_of_stream_video_frame_; |
248 | 248 |
249 private: | 249 private: |
250 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoderTest); | 250 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoderTest); |
251 }; | 251 }; |
252 | 252 |
253 TEST_F(DecryptingVideoDecoderTest, Initialize_Normal) { | 253 TEST_F(DecryptingVideoDecoderTest, Initialize_Normal) { |
254 Initialize(); | 254 Initialize(); |
255 } | 255 } |
256 | 256 |
| 257 TEST_F(DecryptingVideoDecoderTest, Initialize_NullDecryptor) { |
| 258 EXPECT_CALL(*this, RequestDecryptorNotification(_)) |
| 259 .WillRepeatedly(RunCallbackIfNotNull(static_cast<Decryptor*>(NULL))); |
| 260 InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
| 261 DECODER_ERROR_NOT_SUPPORTED); |
| 262 } |
| 263 |
257 TEST_F(DecryptingVideoDecoderTest, Initialize_Failure) { | 264 TEST_F(DecryptingVideoDecoderTest, Initialize_Failure) { |
258 EXPECT_CALL(*decryptor_, InitializeVideoDecoder(_, _)) | 265 EXPECT_CALL(*decryptor_, InitializeVideoDecoder(_, _)) |
259 .WillRepeatedly(RunCallback<1>(false)); | 266 .WillRepeatedly(RunCallback<1>(false)); |
260 EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _)) | 267 EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _)) |
261 .WillRepeatedly(SaveArg<1>(&key_added_cb_)); | 268 .WillRepeatedly(SaveArg<1>(&key_added_cb_)); |
262 | 269 |
263 InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), | 270 InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
264 DECODER_ERROR_NOT_SUPPORTED); | 271 DECODER_ERROR_NOT_SUPPORTED); |
265 } | 272 } |
266 | 273 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 579 |
573 // Test stopping after the decoder has been stopped. | 580 // Test stopping after the decoder has been stopped. |
574 TEST_F(DecryptingVideoDecoderTest, Stop_AfterStop) { | 581 TEST_F(DecryptingVideoDecoderTest, Stop_AfterStop) { |
575 Initialize(); | 582 Initialize(); |
576 EnterNormalDecodingState(); | 583 EnterNormalDecodingState(); |
577 Stop(); | 584 Stop(); |
578 Stop(); | 585 Stop(); |
579 } | 586 } |
580 | 587 |
581 } // namespace media | 588 } // namespace media |
OLD | NEW |