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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |