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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 682 |
683 // Invoked function OnError. This asserts that the pipeline does not enqueue | 683 // Invoked function OnError. This asserts that the pipeline does not enqueue |
684 // non-teardown related tasks while tearing down. | 684 // non-teardown related tasks while tearing down. |
685 static void TestNoCallsAfterError( | 685 static void TestNoCallsAfterError( |
686 Pipeline* pipeline, base::MessageLoop* message_loop, | 686 Pipeline* pipeline, base::MessageLoop* message_loop, |
687 PipelineStatus /* status */) { | 687 PipelineStatus /* status */) { |
688 CHECK(pipeline); | 688 CHECK(pipeline); |
689 CHECK(message_loop); | 689 CHECK(message_loop); |
690 | 690 |
691 // When we get to this stage, the message loop should be empty. | 691 // When we get to this stage, the message loop should be empty. |
692 message_loop->AssertIdle(); | 692 EXPECT_TRUE(message_loop->IsIdleForTesting()); |
693 | 693 |
694 // Make calls on pipeline after error has occurred. | 694 // Make calls on pipeline after error has occurred. |
695 pipeline->SetPlaybackRate(0.5f); | 695 pipeline->SetPlaybackRate(0.5f); |
696 pipeline->SetVolume(0.5f); | 696 pipeline->SetVolume(0.5f); |
697 | 697 |
698 // No additional tasks should be queued as a result of these calls. | 698 // No additional tasks should be queued as a result of these calls. |
699 message_loop->AssertIdle(); | 699 EXPECT_TRUE(message_loop->IsIdleForTesting()); |
700 } | 700 } |
701 | 701 |
702 TEST_F(PipelineTest, NoMessageDuringTearDownFromError) { | 702 TEST_F(PipelineTest, NoMessageDuringTearDownFromError) { |
703 CreateAudioStream(); | 703 CreateAudioStream(); |
704 MockDemuxerStreamVector streams; | 704 MockDemuxerStreamVector streams; |
705 streams.push_back(audio_stream()); | 705 streams.push_back(audio_stream()); |
706 | 706 |
707 InitializeDemuxer(&streams); | 707 InitializeDemuxer(&streams); |
708 InitializeAudioRenderer(audio_stream(), false); | 708 InitializeAudioRenderer(audio_stream(), false); |
709 InitializePipeline(PIPELINE_OK); | 709 InitializePipeline(PIPELINE_OK); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 INSTANTIATE_TEARDOWN_TEST(Error, InitAudioRenderer); | 1170 INSTANTIATE_TEARDOWN_TEST(Error, InitAudioRenderer); |
1171 INSTANTIATE_TEARDOWN_TEST(Error, InitVideoRenderer); | 1171 INSTANTIATE_TEARDOWN_TEST(Error, InitVideoRenderer); |
1172 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); | 1172 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); |
1173 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); | 1173 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); |
1174 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); | 1174 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); |
1175 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); | 1175 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); |
1176 INSTANTIATE_TEARDOWN_TEST(Error, Starting); | 1176 INSTANTIATE_TEARDOWN_TEST(Error, Starting); |
1177 INSTANTIATE_TEARDOWN_TEST(Error, Playing); | 1177 INSTANTIATE_TEARDOWN_TEST(Error, Playing); |
1178 | 1178 |
1179 } // namespace media | 1179 } // namespace media |
OLD | NEW |