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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 SetRendererExpectations(); | 623 SetRendererExpectations(); |
624 StartPipelineAndExpect(PIPELINE_OK); | 624 StartPipelineAndExpect(PIPELINE_OK); |
625 | 625 |
626 AddTextStream(); | 626 AddTextStream(); |
627 | 627 |
628 // The ended callback shouldn't run until all renderers have ended. | 628 // The ended callback shouldn't run until all renderers have ended. |
629 ended_cb_.Run(); | 629 ended_cb_.Run(); |
630 message_loop_.RunUntilIdle(); | 630 message_loop_.RunUntilIdle(); |
631 | 631 |
632 EXPECT_CALL(callbacks_, OnEnded()); | 632 EXPECT_CALL(callbacks_, OnEnded()); |
633 // Since the |ended_cb_| is manually invoked above, the duration does not | |
634 // match the expected duration and is updated upon ended. | |
635 EXPECT_CALL(callbacks_, OnDurationChange()); | |
636 text_stream()->SendEosNotification(); | 633 text_stream()->SendEosNotification(); |
637 message_loop_.RunUntilIdle(); | 634 message_loop_.RunUntilIdle(); |
638 } | 635 } |
639 | 636 |
640 TEST_F(PipelineTest, ErrorDuringSeek) { | 637 TEST_F(PipelineTest, ErrorDuringSeek) { |
641 CreateAudioStream(); | 638 CreateAudioStream(); |
642 MockDemuxerStreamVector streams; | 639 MockDemuxerStreamVector streams; |
643 streams.push_back(audio_stream()); | 640 streams.push_back(audio_stream()); |
644 | 641 |
645 SetDemuxerExpectations(&streams); | 642 SetDemuxerExpectations(&streams); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1005 |
1009 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer); | 1006 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer); |
1010 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer); | 1007 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer); |
1011 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); | 1008 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); |
1012 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); | 1009 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); |
1013 INSTANTIATE_TEARDOWN_TEST(Error, Playing); | 1010 INSTANTIATE_TEARDOWN_TEST(Error, Playing); |
1014 | 1011 |
1015 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); | 1012 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); |
1016 | 1013 |
1017 } // namespace media | 1014 } // namespace media |
OLD | NEW |