| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED, false); | 483 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED, false); |
| 484 Destroy(); | 484 Destroy(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 TEST_F(VideoRendererImplTest, Underflow) { | 487 TEST_F(VideoRendererImplTest, Underflow) { |
| 488 Initialize(); | 488 Initialize(); |
| 489 QueueFrames("0 10 20 30"); | 489 QueueFrames("0 10 20 30"); |
| 490 | 490 |
| 491 { | 491 { |
| 492 WaitableMessageLoopEvent event; | 492 WaitableMessageLoopEvent event; |
| 493 EXPECT_CALL(mock_cb_, Display(HasTimestamp(0))) | 493 EXPECT_CALL(mock_cb_, Display(HasTimestamp(0))); |
| 494 .Times(1) | 494 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH)) |
| 495 .WillOnce(RunClosure(event.GetClosure())); | 495 .WillOnce(RunClosure(event.GetClosure())); |
| 496 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH)); | |
| 497 StartPlayingFrom(0); | 496 StartPlayingFrom(0); |
| 498 event.RunAndWait(); | 497 event.RunAndWait(); |
| 499 Mock::VerifyAndClearExpectations(&mock_cb_); | 498 Mock::VerifyAndClearExpectations(&mock_cb_); |
| 500 } | 499 } |
| 501 | 500 |
| 502 // Advance time slightly. Frames should be dropped and we should NOT signal | 501 // Advance time slightly. Frames should be dropped and we should NOT signal |
| 503 // having nothing. | 502 // having nothing. |
| 504 AdvanceTimeInMs(100); | 503 AdvanceTimeInMs(100); |
| 505 | 504 |
| 506 // Advance time more. Now we should signal having nothing. And put | 505 // Advance time more. Now we should signal having nothing. And put |
| (...skipping 19 matching lines...) Expand all Loading... |
| 526 .WillOnce(RunClosure(event.GetClosure())); | 525 .WillOnce(RunClosure(event.GetClosure())); |
| 527 SatisfyPendingReadWithEndOfStream(); | 526 SatisfyPendingReadWithEndOfStream(); |
| 528 event.RunAndWait(); | 527 event.RunAndWait(); |
| 529 } | 528 } |
| 530 | 529 |
| 531 WaitForEnded(); | 530 WaitForEnded(); |
| 532 Destroy(); | 531 Destroy(); |
| 533 } | 532 } |
| 534 | 533 |
| 535 } // namespace media | 534 } // namespace media |
| OLD | NEW |