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

Side by Side Diff: media/filters/decrypting_demuxer_stream_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_demuxer_stream.cc ('k') | media/filters/decrypting_video_decoder.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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 EXPECT_EQ(input_config.visible_rect(), output_config.visible_rect()); 251 EXPECT_EQ(input_config.visible_rect(), output_config.visible_rect());
252 EXPECT_EQ(input_config.natural_size(), output_config.natural_size()); 252 EXPECT_EQ(input_config.natural_size(), output_config.natural_size());
253 ASSERT_EQ(input_config.extra_data_size(), output_config.extra_data_size()); 253 ASSERT_EQ(input_config.extra_data_size(), output_config.extra_data_size());
254 if (input_config.extra_data_size() > 0) { 254 if (input_config.extra_data_size() > 0) {
255 EXPECT_FALSE(output_config.extra_data()); 255 EXPECT_FALSE(output_config.extra_data());
256 EXPECT_EQ(0, memcmp(output_config.extra_data(), input_config.extra_data(), 256 EXPECT_EQ(0, memcmp(output_config.extra_data(), input_config.extra_data(),
257 input_config.extra_data_size())); 257 input_config.extra_data_size()));
258 } 258 }
259 } 259 }
260 260
261 TEST_F(DecryptingDemuxerStreamTest, Initialize_NullDecryptor) {
262 EXPECT_CALL(*this, RequestDecryptorNotification(_))
263 .WillRepeatedly(RunCallbackIfNotNull(static_cast<Decryptor*>(NULL)));
264
265 AudioDecoderConfig input_config(kCodecVorbis, kSampleFormatPlanarF32,
266 CHANNEL_LAYOUT_STEREO, 44100, NULL, 0, true);
267 InitializeAudioAndExpectStatus(input_config, DECODER_ERROR_NOT_SUPPORTED);
268 }
269
261 // Test normal read case. 270 // Test normal read case.
262 TEST_F(DecryptingDemuxerStreamTest, Read_Normal) { 271 TEST_F(DecryptingDemuxerStreamTest, Read_Normal) {
263 Initialize(); 272 Initialize();
264 EnterNormalReadingState(); 273 EnterNormalReadingState();
265 } 274 }
266 275
267 // Test the case where the decryptor returns error during read. 276 // Test the case where the decryptor returns error during read.
268 TEST_F(DecryptingDemuxerStreamTest, Read_DecryptError) { 277 TEST_F(DecryptingDemuxerStreamTest, Read_DecryptError) {
269 Initialize(); 278 Initialize();
270 279
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 input_audio_stream_->set_audio_decoder_config(new_config); 418 input_audio_stream_->set_audio_decoder_config(new_config);
410 419
411 EXPECT_CALL(*input_audio_stream_, Read(_)) 420 EXPECT_CALL(*input_audio_stream_, Read(_))
412 .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, 421 .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged,
413 scoped_refptr<DecoderBuffer>())); 422 scoped_refptr<DecoderBuffer>()));
414 423
415 ReadAndExpectBufferReadyWith(DemuxerStream::kConfigChanged, NULL); 424 ReadAndExpectBufferReadyWith(DemuxerStream::kConfigChanged, NULL);
416 } 425 }
417 426
418 } // namespace media 427 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/decrypting_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698