OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "media/base/pipeline_impl.h" | 9 #include "media/base/pipeline_impl.h" |
10 #include "media/base/media_format.h" | 10 #include "media/base/media_format.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 EXPECT_CALL(*mocks_->demuxer(), GetNumberOfStreams()) | 111 EXPECT_CALL(*mocks_->demuxer(), GetNumberOfStreams()) |
112 .WillRepeatedly(Return(streams->size())); | 112 .WillRepeatedly(Return(streams->size())); |
113 EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(0.0f)); | 113 EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(0.0f)); |
114 EXPECT_CALL(*mocks_->demuxer(), Seek(base::TimeDelta(), NotNull())) | 114 EXPECT_CALL(*mocks_->demuxer(), Seek(base::TimeDelta(), NotNull())) |
115 .WillOnce(Invoke(&RunFilterCallback)); | 115 .WillOnce(Invoke(&RunFilterCallback)); |
116 EXPECT_CALL(*mocks_->demuxer(), Stop(NotNull())) | 116 EXPECT_CALL(*mocks_->demuxer(), Stop(NotNull())) |
117 .WillOnce(Invoke(&RunStopFilterCallback)); | 117 .WillOnce(Invoke(&RunStopFilterCallback)); |
118 | 118 |
119 // Configure the demuxer to return the streams. | 119 // Configure the demuxer to return the streams. |
120 for (size_t i = 0; i < streams->size(); ++i) { | 120 for (size_t i = 0; i < streams->size(); ++i) { |
121 scoped_refptr<DemuxerStream> stream = (*streams)[i]; | 121 scoped_refptr<DemuxerStream> stream((*streams)[i]); |
122 EXPECT_CALL(*mocks_->demuxer(), GetStream(i)) | 122 EXPECT_CALL(*mocks_->demuxer(), GetStream(i)) |
123 .WillRepeatedly(Return(stream)); | 123 .WillRepeatedly(Return(stream)); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 // Create a stream with an associated media format. | 127 // Create a stream with an associated media format. |
128 StrictMock<MockDemuxerStream>* CreateStream(const std::string& mime_type) { | 128 StrictMock<MockDemuxerStream>* CreateStream(const std::string& mime_type) { |
129 StrictMock<MockDemuxerStream>* stream = | 129 StrictMock<MockDemuxerStream>* stream = |
130 new StrictMock<MockDemuxerStream>(); | 130 new StrictMock<MockDemuxerStream>(); |
131 | 131 |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 | 680 |
681 EXPECT_CALL(*mocks_->audio_renderer(), HasEnded()) | 681 EXPECT_CALL(*mocks_->audio_renderer(), HasEnded()) |
682 .WillOnce(Return(true)); | 682 .WillOnce(Return(true)); |
683 EXPECT_CALL(*mocks_->video_renderer(), HasEnded()) | 683 EXPECT_CALL(*mocks_->video_renderer(), HasEnded()) |
684 .WillOnce(Return(true)); | 684 .WillOnce(Return(true)); |
685 EXPECT_CALL(callbacks_, OnEnded()); | 685 EXPECT_CALL(callbacks_, OnEnded()); |
686 host->NotifyEnded(); | 686 host->NotifyEnded(); |
687 } | 687 } |
688 | 688 |
689 } // namespace media | 689 } // namespace media |
OLD | NEW |