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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 EXPECT_CALL(*audio_renderer_, Flush(_)) | 262 EXPECT_CALL(*audio_renderer_, Flush(_)) |
263 .WillOnce(RunClosure<0>()); | 263 .WillOnce(RunClosure<0>()); |
264 EXPECT_CALL(*audio_renderer_, Preroll(seek_time, _)) | 264 EXPECT_CALL(*audio_renderer_, Preroll(seek_time, _)) |
265 .WillOnce(RunCallback<1>(PIPELINE_OK)); | 265 .WillOnce(RunCallback<1>(PIPELINE_OK)); |
266 EXPECT_CALL(*audio_renderer_, SetPlaybackRate(_)); | 266 EXPECT_CALL(*audio_renderer_, SetPlaybackRate(_)); |
267 EXPECT_CALL(*audio_renderer_, SetVolume(_)); | 267 EXPECT_CALL(*audio_renderer_, SetVolume(_)); |
268 EXPECT_CALL(*audio_renderer_, Play()); | 268 EXPECT_CALL(*audio_renderer_, Play()); |
269 } | 269 } |
270 | 270 |
271 if (video_stream_) { | 271 if (video_stream_) { |
272 EXPECT_CALL(*video_renderer_, Pause(_)) | |
273 .WillOnce(RunClosure<0>()); | |
274 EXPECT_CALL(*video_renderer_, Flush(_)) | 272 EXPECT_CALL(*video_renderer_, Flush(_)) |
275 .WillOnce(RunClosure<0>()); | 273 .WillOnce(RunClosure<0>()); |
276 EXPECT_CALL(*video_renderer_, Preroll(seek_time, _)) | 274 EXPECT_CALL(*video_renderer_, Preroll(seek_time, _)) |
277 .WillOnce(RunCallback<1>(PIPELINE_OK)); | 275 .WillOnce(RunCallback<1>(PIPELINE_OK)); |
278 EXPECT_CALL(*video_renderer_, SetPlaybackRate(_)); | 276 EXPECT_CALL(*video_renderer_, SetPlaybackRate(_)); |
279 EXPECT_CALL(*video_renderer_, Play(_)) | 277 EXPECT_CALL(*video_renderer_, Play(_)) |
280 .WillOnce(RunClosure<0>()); | 278 .WillOnce(RunClosure<0>()); |
281 } | 279 } |
282 | 280 |
283 EXPECT_CALL(callbacks_, OnPrerollCompleted()); | 281 EXPECT_CALL(callbacks_, OnPrerollCompleted()); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } else { | 1042 } else { |
1045 status = PIPELINE_ERROR_READ; | 1043 status = PIPELINE_ERROR_READ; |
1046 EXPECT_CALL(*audio_renderer_, Pause()) | 1044 EXPECT_CALL(*audio_renderer_, Pause()) |
1047 .WillOnce(SetError(pipeline_.get(), status)); | 1045 .WillOnce(SetError(pipeline_.get(), status)); |
1048 } | 1046 } |
1049 | 1047 |
1050 return status; | 1048 return status; |
1051 } | 1049 } |
1052 | 1050 |
1053 EXPECT_CALL(*audio_renderer_, Pause()); | 1051 EXPECT_CALL(*audio_renderer_, Pause()); |
1054 EXPECT_CALL(*video_renderer_, Pause(_)).WillOnce(RunClosure<0>()); | |
1055 | 1052 |
1056 if (state == kFlushing) { | 1053 if (state == kFlushing) { |
1057 if (stop_or_error == kStop) { | 1054 if (stop_or_error == kStop) { |
1058 EXPECT_CALL(*audio_renderer_, Flush(_)) | 1055 EXPECT_CALL(*audio_renderer_, Flush(_)) |
1059 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb), RunClosure<0>())); | 1056 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb), RunClosure<0>())); |
1060 } else { | 1057 } else { |
1061 status = PIPELINE_ERROR_READ; | 1058 status = PIPELINE_ERROR_READ; |
1062 EXPECT_CALL(*audio_renderer_, Flush(_)).WillOnce( | 1059 EXPECT_CALL(*audio_renderer_, Flush(_)).WillOnce( |
1063 DoAll(SetError(pipeline_.get(), status), RunClosure<0>())); | 1060 DoAll(SetError(pipeline_.get(), status), RunClosure<0>())); |
1064 } | 1061 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); | 1177 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); |
1181 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); | 1178 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); |
1182 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); | 1179 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); |
1183 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); | 1180 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); |
1184 INSTANTIATE_TEARDOWN_TEST(Error, Starting); | 1181 INSTANTIATE_TEARDOWN_TEST(Error, Starting); |
1185 INSTANTIATE_TEARDOWN_TEST(Error, Playing); | 1182 INSTANTIATE_TEARDOWN_TEST(Error, Playing); |
1186 | 1183 |
1187 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); | 1184 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); |
1188 | 1185 |
1189 } // namespace media | 1186 } // namespace media |
OLD | NEW |