| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 SetRendererExpectations(); | 611 SetRendererExpectations(); |
| 612 StartPipelineAndExpect(PIPELINE_OK); | 612 StartPipelineAndExpect(PIPELINE_OK); |
| 613 | 613 |
| 614 AddTextStream(); | 614 AddTextStream(); |
| 615 | 615 |
| 616 // The ended callback shouldn't run until all renderers have ended. | 616 // The ended callback shouldn't run until all renderers have ended. |
| 617 ended_cb_.Run(); | 617 ended_cb_.Run(); |
| 618 message_loop_.RunUntilIdle(); | 618 message_loop_.RunUntilIdle(); |
| 619 | 619 |
| 620 EXPECT_CALL(callbacks_, OnEnded()); | 620 EXPECT_CALL(callbacks_, OnEnded()); |
| 621 // There are cases where duration is reported wrong initially, so there is | 621 // Since the |ended_cb_| is manually invoked above, the duration does not |
| 622 // an OnDurationChange event fired again on OnEnded event if required. | 622 // match the expected duration and is updated upon ended. |
| 623 EXPECT_CALL(callbacks_, OnDurationChange()); | 623 EXPECT_CALL(callbacks_, OnDurationChange()); |
| 624 text_stream()->SendEosNotification(); | 624 text_stream()->SendEosNotification(); |
| 625 message_loop_.RunUntilIdle(); | 625 message_loop_.RunUntilIdle(); |
| 626 } | 626 } |
| 627 | 627 |
| 628 TEST_F(PipelineTest, ErrorDuringSeek) { | 628 TEST_F(PipelineTest, ErrorDuringSeek) { |
| 629 CreateAudioStream(); | 629 CreateAudioStream(); |
| 630 MockDemuxerStreamVector streams; | 630 MockDemuxerStreamVector streams; |
| 631 streams.push_back(audio_stream()); | 631 streams.push_back(audio_stream()); |
| 632 | 632 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 | 995 |
| 996 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer); | 996 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer); |
| 997 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer); | 997 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer); |
| 998 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); | 998 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); |
| 999 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); | 999 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); |
| 1000 INSTANTIATE_TEARDOWN_TEST(Error, Playing); | 1000 INSTANTIATE_TEARDOWN_TEST(Error, Playing); |
| 1001 | 1001 |
| 1002 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); | 1002 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); |
| 1003 | 1003 |
| 1004 } // namespace media | 1004 } // namespace media |
| OLD | NEW |