OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 EXPECT_CALL(*video_renderer_, OnTimeStopped()); | 493 EXPECT_CALL(*video_renderer_, OnTimeStopped()); |
494 SetPlaybackRate(1.0); | 494 SetPlaybackRate(1.0); |
495 Flush(false); | 495 Flush(false); |
496 | 496 |
497 // A positive playback rate when playback isn't started should do nothing. | 497 // A positive playback rate when playback isn't started should do nothing. |
498 SetPlaybackRate(1.0); | 498 SetPlaybackRate(1.0); |
499 } | 499 } |
500 | 500 |
501 TEST_F(RendererImplTest, FlushAfterInitialization) { | 501 TEST_F(RendererImplTest, FlushAfterInitialization) { |
502 InitializeWithAudioAndVideo(); | 502 InitializeWithAudioAndVideo(); |
503 Flush(true); | 503 EXPECT_CALL(callbacks_, OnFlushed()); |
| 504 renderer_impl_->Flush( |
| 505 base::Bind(&CallbackHelper::OnFlushed, base::Unretained(&callbacks_))); |
| 506 base::RunLoop().RunUntilIdle(); |
504 } | 507 } |
505 | 508 |
506 TEST_F(RendererImplTest, FlushAfterPlay) { | 509 TEST_F(RendererImplTest, FlushAfterPlay) { |
507 InitializeWithAudioAndVideo(); | 510 InitializeWithAudioAndVideo(); |
508 Play(); | 511 Play(); |
509 Flush(false); | 512 Flush(false); |
510 } | 513 } |
511 | 514 |
512 TEST_F(RendererImplTest, FlushAfterUnderflow) { | 515 TEST_F(RendererImplTest, FlushAfterUnderflow) { |
513 InitializeWithAudioAndVideo(); | 516 InitializeWithAudioAndVideo(); |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 EXPECT_CALL(*video_renderer_, OnTimeStopped()).Times(testing::AnyNumber()); | 1066 EXPECT_CALL(*video_renderer_, OnTimeStopped()).Times(testing::AnyNumber()); |
1064 EXPECT_CALL(*video_renderer_, | 1067 EXPECT_CALL(*video_renderer_, |
1065 Initialize(secondary_video_stream.get(), _, _, _, _)); | 1068 Initialize(secondary_video_stream.get(), _, _, _, _)); |
1066 | 1069 |
1067 video_renderer_client_->OnBufferingStateChange(BUFFERING_HAVE_NOTHING); | 1070 video_renderer_client_->OnBufferingStateChange(BUFFERING_HAVE_NOTHING); |
1068 video_renderer_flush_cb.Run(); | 1071 video_renderer_flush_cb.Run(); |
1069 base::RunLoop().RunUntilIdle(); | 1072 base::RunLoop().RunUntilIdle(); |
1070 } | 1073 } |
1071 | 1074 |
1072 } // namespace media | 1075 } // namespace media |
OLD | NEW |