| 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 "content/common/child_process.h" | 6 #include "content/common/child_process.h" |
| 7 #include "content/renderer/media/capture_video_decoder.h" | 7 #include "content/renderer/media/capture_video_decoder.h" |
| 8 #include "content/renderer/media/video_capture_impl.h" | 8 #include "content/renderer/media/video_capture_impl.h" |
| 9 #include "content/renderer/media/video_capture_impl_manager.h" | 9 #include "content/renderer/media/video_capture_impl_manager.h" |
| 10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 message_loop_->RunAllPending(); | 210 message_loop_->RunAllPending(); |
| 211 | 211 |
| 212 Stop(); | 212 Stop(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 TEST_F(CaptureVideoDecoderTest, ReadAndShutdown) { | 215 TEST_F(CaptureVideoDecoderTest, ReadAndShutdown) { |
| 216 // Test all the Read requests can be fullfilled (which is needed in order to | 216 // Test all the Read requests can be fullfilled (which is needed in order to |
| 217 // teardown the pipeline) even when there's no input frame. | 217 // teardown the pipeline) even when there's no input frame. |
| 218 Initialize(); | 218 Initialize(); |
| 219 | 219 |
| 220 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, | 220 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, HasSize(0, 0))); |
| 221 HasSize(0, 0))).Times(2); | |
| 222 decoder_->Read(read_cb_); | 221 decoder_->Read(read_cb_); |
| 223 decoder_->PrepareForShutdownHack(); | 222 Stop(); |
| 223 |
| 224 // Any read after stopping should be immediately satisfied. |
| 225 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, HasSize(0, 0))); |
| 224 decoder_->Read(read_cb_); | 226 decoder_->Read(read_cb_); |
| 225 message_loop_->RunAllPending(); | 227 message_loop_->RunAllPending(); |
| 226 | |
| 227 Stop(); | |
| 228 } | 228 } |
| OLD | NEW |