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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 protected: | 90 protected: |
91 void Destroy() { | 91 void Destroy() { |
92 renderer_impl_.reset(); | 92 renderer_impl_.reset(); |
93 base::RunLoop().RunUntilIdle(); | 93 base::RunLoop().RunUntilIdle(); |
94 } | 94 } |
95 | 95 |
96 std::unique_ptr<StrictMock<MockDemuxerStream>> CreateStream( | 96 std::unique_ptr<StrictMock<MockDemuxerStream>> CreateStream( |
97 DemuxerStream::Type type) { | 97 DemuxerStream::Type type) { |
98 std::unique_ptr<StrictMock<MockDemuxerStream>> stream( | 98 std::unique_ptr<StrictMock<MockDemuxerStream>> stream( |
99 new StrictMock<MockDemuxerStream>(type)); | 99 new StrictMock<MockDemuxerStream>(type)); |
100 EXPECT_CALL(*stream, enabled()).WillRepeatedly(Return(true)); | |
101 EXPECT_CALL(*demuxer_, SetStreamStatusChangeCB(_)) | 100 EXPECT_CALL(*demuxer_, SetStreamStatusChangeCB(_)) |
102 .Times(testing::AnyNumber()); | 101 .Times(testing::AnyNumber()); |
103 return stream; | 102 return stream; |
104 } | 103 } |
105 | 104 |
106 // Sets up expectations to allow the audio renderer to initialize. | 105 // Sets up expectations to allow the audio renderer to initialize. |
107 void SetAudioRendererInitializeExpectations(PipelineStatus status) { | 106 void SetAudioRendererInitializeExpectations(PipelineStatus status) { |
108 EXPECT_CALL(*audio_renderer_, Initialize(audio_stream_.get(), _, _, _)) | 107 EXPECT_CALL(*audio_renderer_, Initialize(audio_stream_.get(), _, _, _)) |
109 .WillOnce( | 108 .WillOnce( |
110 DoAll(SaveArg<2>(&audio_renderer_client_), RunCallback<3>(status))); | 109 DoAll(SaveArg<2>(&audio_renderer_client_), RunCallback<3>(status))); |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 // change processing involves Flush + StartPlaying when the Flush is done. The | 842 // change processing involves Flush + StartPlaying when the Flush is done. The |
844 // Flush operation is async in this case, so the second status change will be | 843 // Flush operation is async in this case, so the second status change will be |
845 // postponed by renderer until after processing the first one is finished. But | 844 // postponed by renderer until after processing the first one is finished. But |
846 // we must still get two pairs of Flush/StartPlaying calls eventually. | 845 // we must still get two pairs of Flush/StartPlaying calls eventually. |
847 stream_status_change_cb.Run(video_stream_.get(), false, base::TimeDelta()); | 846 stream_status_change_cb.Run(video_stream_.get(), false, base::TimeDelta()); |
848 stream_status_change_cb.Run(video_stream_.get(), true, base::TimeDelta()); | 847 stream_status_change_cb.Run(video_stream_.get(), true, base::TimeDelta()); |
849 base::RunLoop().Run(); | 848 base::RunLoop().Run(); |
850 } | 849 } |
851 | 850 |
852 } // namespace media | 851 } // namespace media |
OLD | NEW |