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

Side by Side Diff: media/filters/decrypting_video_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_video_decoder.cc ('k') | no next file » | 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « media/filters/decrypting_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698