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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 EXPECT_CALL(*decryptor_, InitializeAudioDecoder(_, _)) | 263 EXPECT_CALL(*decryptor_, InitializeAudioDecoder(_, _)) |
264 .WillOnce(RunCallback<1>(false)); | 264 .WillOnce(RunCallback<1>(false)); |
265 EXPECT_CALL(*this, RequestDecryptorNotification(_)) | 265 EXPECT_CALL(*this, RequestDecryptorNotification(_)) |
266 .WillOnce(RunCallbackIfNotNull(decryptor_.get())); | 266 .WillOnce(RunCallbackIfNotNull(decryptor_.get())); |
267 | 267 |
268 AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32, | 268 AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32, |
269 CHANNEL_LAYOUT_STEREO, 44100, NULL, 0, true); | 269 CHANNEL_LAYOUT_STEREO, 44100, NULL, 0, true); |
270 InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED); | 270 InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED); |
271 } | 271 } |
272 | 272 |
| 273 TEST_F(DecryptingAudioDecoderTest, Initialize_NullDecryptor) { |
| 274 EXPECT_CALL(*this, RequestDecryptorNotification(_)) |
| 275 .WillRepeatedly(RunCallbackIfNotNull(static_cast<Decryptor*>(NULL))); |
| 276 |
| 277 AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32, |
| 278 CHANNEL_LAYOUT_STEREO, 44100, NULL, 0, true); |
| 279 InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED); |
| 280 } |
| 281 |
273 // Test normal decrypt and decode case. | 282 // Test normal decrypt and decode case. |
274 TEST_F(DecryptingAudioDecoderTest, DecryptAndDecode_Normal) { | 283 TEST_F(DecryptingAudioDecoderTest, DecryptAndDecode_Normal) { |
275 Initialize(); | 284 Initialize(); |
276 EnterNormalDecodingState(); | 285 EnterNormalDecodingState(); |
277 } | 286 } |
278 | 287 |
279 // Test the case where the decryptor returns error when doing decrypt and | 288 // Test the case where the decryptor returns error when doing decrypt and |
280 // decode. | 289 // decode. |
281 TEST_F(DecryptingAudioDecoderTest, DecryptAndDecode_DecodeError) { | 290 TEST_F(DecryptingAudioDecoderTest, DecryptAndDecode_DecodeError) { |
282 Initialize(); | 291 Initialize(); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 587 |
579 // Test resetting after the decoder has been reset. | 588 // Test resetting after the decoder has been reset. |
580 TEST_F(DecryptingAudioDecoderTest, Reset_AfterReset) { | 589 TEST_F(DecryptingAudioDecoderTest, Reset_AfterReset) { |
581 Initialize(); | 590 Initialize(); |
582 EnterNormalDecodingState(); | 591 EnterNormalDecodingState(); |
583 Reset(); | 592 Reset(); |
584 Reset(); | 593 Reset(); |
585 } | 594 } |
586 | 595 |
587 } // namespace media | 596 } // namespace media |
OLD | NEW |