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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback_helpers.h" | 6 #include "base/callback_helpers.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "media/base/gmock_callback_support.h" | 8 #include "media/base/gmock_callback_support.h" |
9 #include "media/base/mock_filters.h" | 9 #include "media/base/mock_filters.h" |
10 #include "media/base/test_helpers.h" | 10 #include "media/base/test_helpers.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 is_initialized_ = success; | 126 is_initialized_ = success; |
127 if (!success) | 127 if (!success) |
128 decoder_ = NULL; | 128 decoder_ = NULL; |
129 } | 129 } |
130 | 130 |
131 void InitializeVideoFrameStream() { | 131 void InitializeVideoFrameStream() { |
132 pending_initialize_ = true; | 132 pending_initialize_ = true; |
133 video_frame_stream_->Initialize( | 133 video_frame_stream_->Initialize( |
134 demuxer_stream_.get(), | 134 demuxer_stream_.get(), |
135 false, | |
136 base::Bind(&VideoFrameStreamTest::OnStatistics, base::Unretained(this)), | 135 base::Bind(&VideoFrameStreamTest::OnStatistics, base::Unretained(this)), |
137 base::Bind(&VideoFrameStreamTest::OnInitialized, | 136 base::Bind(&VideoFrameStreamTest::OnInitialized, |
138 base::Unretained(this))); | 137 base::Unretained(this))); |
139 message_loop_.RunUntilIdle(); | 138 message_loop_.RunUntilIdle(); |
140 } | 139 } |
141 | 140 |
142 // Fake Decrypt() function used by DecryptingDemuxerStream. It does nothing | 141 // Fake Decrypt() function used by DecryptingDemuxerStream. It does nothing |
143 // but removes the DecryptConfig to make the buffer unencrypted. | 142 // but removes the DecryptConfig to make the buffer unencrypted. |
144 void Decrypt(Decryptor::StreamType stream_type, | 143 void Decrypt(Decryptor::StreamType stream_type, |
145 const scoped_refptr<DecoderBuffer>& encrypted, | 144 const scoped_refptr<DecoderBuffer>& encrypted, |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 // The error must surface from Read() as DECODE_ERROR. | 753 // The error must surface from Read() as DECODE_ERROR. |
755 while (last_read_status_ == VideoFrameStream::OK) { | 754 while (last_read_status_ == VideoFrameStream::OK) { |
756 ReadOneFrame(); | 755 ReadOneFrame(); |
757 message_loop_.RunUntilIdle(); | 756 message_loop_.RunUntilIdle(); |
758 EXPECT_FALSE(pending_read_); | 757 EXPECT_FALSE(pending_read_); |
759 } | 758 } |
760 EXPECT_EQ(VideoFrameStream::DECODE_ERROR, last_read_status_); | 759 EXPECT_EQ(VideoFrameStream::DECODE_ERROR, last_read_status_); |
761 } | 760 } |
762 | 761 |
763 } // namespace media | 762 } // namespace media |
OLD | NEW |