| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 { | 332 { |
| 333 SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING"); | 333 SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING"); |
| 334 WaitableMessageLoopEvent event; | 334 WaitableMessageLoopEvent event; |
| 335 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING)) | 335 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING)) |
| 336 .WillOnce(RunClosure(event.GetClosure())); | 336 .WillOnce(RunClosure(event.GetClosure())); |
| 337 AdvanceTimeInMs(30); | 337 AdvanceTimeInMs(30); |
| 338 event.RunAndWait(); | 338 event.RunAndWait(); |
| 339 Mock::VerifyAndClearExpectations(&mock_cb_); | 339 Mock::VerifyAndClearExpectations(&mock_cb_); |
| 340 } | 340 } |
| 341 | 341 |
| 342 // Simulate delayed buffering state callbacks. |
| 343 renderer_->OnTimeStateChanged(false); |
| 344 renderer_->OnTimeStateChanged(true); |
| 345 |
| 342 // Receiving end of stream should signal having enough. | 346 // Receiving end of stream should signal having enough. |
| 343 { | 347 { |
| 344 SCOPED_TRACE("Waiting for BUFFERING_HAVE_ENOUGH"); | 348 SCOPED_TRACE("Waiting for BUFFERING_HAVE_ENOUGH"); |
| 345 WaitableMessageLoopEvent event; | 349 WaitableMessageLoopEvent event; |
| 346 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH)) | 350 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH)) |
| 347 .WillOnce(RunClosure(event.GetClosure())); | 351 .WillOnce(RunClosure(event.GetClosure())); |
| 348 SatisfyPendingReadWithEndOfStream(); | 352 SatisfyPendingReadWithEndOfStream(); |
| 349 event.RunAndWait(); | 353 event.RunAndWait(); |
| 350 } | 354 } |
| 351 | 355 |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 QueueFrames("0 10 20 30"); | 898 QueueFrames("0 10 20 30"); |
| 895 StartPlayingFrom(0); | 899 StartPlayingFrom(0); |
| 896 Flush(); | 900 Flush(); |
| 897 ASSERT_EQ(1u, frame_ready_cbs_.size()); | 901 ASSERT_EQ(1u, frame_ready_cbs_.size()); |
| 898 // This frame will be discarded. | 902 // This frame will be discarded. |
| 899 frame_ready_cbs_.front().Run(); | 903 frame_ready_cbs_.front().Run(); |
| 900 Destroy(); | 904 Destroy(); |
| 901 } | 905 } |
| 902 | 906 |
| 903 } // namespace media | 907 } // namespace media |
| OLD | NEW |