Chromium Code Reviews| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 | 212 |
| 213 case SET_DECRYPTOR: | 213 case SET_DECRYPTOR: |
| 214 // Hold DecryptorReadyCB. | 214 // Hold DecryptorReadyCB. |
| 215 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)) | 215 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)) |
| 216 .Times(2); | 216 .Times(2); |
| 217 // Initialize will fail because no decryptor is available. | 217 // Initialize will fail because no decryptor is available. |
| 218 InitializeVideoFrameStream(); | 218 InitializeVideoFrameStream(); |
| 219 break; | 219 break; |
| 220 | 220 |
| 221 case DECRYPTOR_NO_KEY: | 221 case DECRYPTOR_NO_KEY: |
| 222 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)) | 222 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)).WillRepeatedly( |
| 223 .WillRepeatedly(RunCallback<0>(decryptor_.get())); | 223 RunCallback<0>(decryptor_.get(), base::Bind(&base::DoNothing))); |
|
ddorwin
2014/07/30 22:35:46
ditto
| |
| 224 has_no_key_ = true; | 224 has_no_key_ = true; |
| 225 ReadOneFrame(); | 225 ReadOneFrame(); |
| 226 break; | 226 break; |
| 227 | 227 |
| 228 case DECODER_INIT: | 228 case DECODER_INIT: |
| 229 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)) | 229 EXPECT_CALL(*this, SetDecryptorReadyCallback(_)).WillRepeatedly( |
| 230 .WillRepeatedly(RunCallback<0>(decryptor_.get())); | 230 RunCallback<0>(decryptor_.get(), base::Bind(&base::DoNothing))); |
| 231 decoder_->HoldNextInit(); | 231 decoder_->HoldNextInit(); |
| 232 InitializeVideoFrameStream(); | 232 InitializeVideoFrameStream(); |
| 233 break; | 233 break; |
| 234 | 234 |
| 235 case DECODER_REINIT: | 235 case DECODER_REINIT: |
| 236 decoder_->HoldNextInit(); | 236 decoder_->HoldNextInit(); |
| 237 ReadUntilPending(); | 237 ReadUntilPending(); |
| 238 break; | 238 break; |
| 239 | 239 |
| 240 case DECODER_DECODE: | 240 case DECODER_DECODE: |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 // The error must surface from Read() as DECODE_ERROR. | 685 // The error must surface from Read() as DECODE_ERROR. |
| 686 while (last_read_status_ == VideoFrameStream::OK) { | 686 while (last_read_status_ == VideoFrameStream::OK) { |
| 687 ReadOneFrame(); | 687 ReadOneFrame(); |
| 688 message_loop_.RunUntilIdle(); | 688 message_loop_.RunUntilIdle(); |
| 689 EXPECT_FALSE(pending_read_); | 689 EXPECT_FALSE(pending_read_); |
| 690 } | 690 } |
| 691 EXPECT_EQ(VideoFrameStream::DECODE_ERROR, last_read_status_); | 691 EXPECT_EQ(VideoFrameStream::DECODE_ERROR, last_read_status_); |
| 692 } | 692 } |
| 693 | 693 |
| 694 } // namespace media | 694 } // namespace media |
| OLD | NEW |