Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: media/filters/decrypting_audio_decoder_unittest.cc

Issue 17422002: Encrypted Media: DecryptingXxx::SetDecryptor() accepts NULL decryptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add todo and bug. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/decrypting_audio_decoder.cc ('k') | media/filters/decrypting_demuxer_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/filters/decrypting_audio_decoder.cc ('k') | media/filters/decrypting_demuxer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698