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 "media/base/pipeline_impl.h" | 5 #include "media/base/pipeline_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000)); | 891 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000)); |
892 | 892 |
893 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true)); | 893 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true)); |
894 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true)); | 894 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true)); |
895 | 895 |
896 if (state == kInitRenderer) { | 896 if (state == kInitRenderer) { |
897 if (stop_or_error == kStop) { | 897 if (stop_or_error == kStop) { |
898 EXPECT_CALL(*renderer_, Initialize(_, _, _)) | 898 EXPECT_CALL(*renderer_, Initialize(_, _, _)) |
899 .WillOnce( | 899 .WillOnce( |
900 DoAll(Stop(pipeline_.get()), PostCallback<2>(PIPELINE_OK))); | 900 DoAll(Stop(pipeline_.get()), PostCallback<2>(PIPELINE_OK))); |
901 // Note: OnStart or OnMetadata callback are not called | 901 // Note: OnStart is not callback after pipeline is stopped. |
902 // after pipeline is stopped. | |
903 } else { | 902 } else { |
904 EXPECT_CALL(*renderer_, Initialize(_, _, _)) | 903 EXPECT_CALL(*renderer_, Initialize(_, _, _)) |
905 .WillOnce(PostCallback<2>(PIPELINE_ERROR_INITIALIZATION_FAILED)); | 904 .WillOnce(PostCallback<2>(PIPELINE_ERROR_INITIALIZATION_FAILED)); |
906 EXPECT_CALL(callbacks_, OnMetadata(_)); | |
907 EXPECT_CALL(callbacks_, OnStart(PIPELINE_ERROR_INITIALIZATION_FAILED)); | 905 EXPECT_CALL(callbacks_, OnStart(PIPELINE_ERROR_INITIALIZATION_FAILED)); |
908 } | 906 } |
909 | 907 |
| 908 EXPECT_CALL(callbacks_, OnMetadata(_)); |
910 EXPECT_CALL(*demuxer_, Stop()); | 909 EXPECT_CALL(*demuxer_, Stop()); |
911 return; | 910 return; |
912 } | 911 } |
913 | 912 |
914 EXPECT_CALL(*renderer_, Initialize(_, _, _)) | 913 EXPECT_CALL(*renderer_, Initialize(_, _, _)) |
915 .WillOnce( | 914 .WillOnce( |
916 DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK))); | 915 DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK))); |
917 | 916 |
918 // If we get here it's a successful initialization. | 917 // If we get here it's a successful initialization. |
919 EXPECT_CALL(callbacks_, OnStart(PIPELINE_OK)); | 918 EXPECT_CALL(callbacks_, OnStart(PIPELINE_OK)); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); | 1074 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); |
1076 INSTANTIATE_TEARDOWN_TEST(Error, Playing); | 1075 INSTANTIATE_TEARDOWN_TEST(Error, Playing); |
1077 INSTANTIATE_TEARDOWN_TEST(Error, Suspending); | 1076 INSTANTIATE_TEARDOWN_TEST(Error, Suspending); |
1078 INSTANTIATE_TEARDOWN_TEST(Error, Suspended); | 1077 INSTANTIATE_TEARDOWN_TEST(Error, Suspended); |
1079 INSTANTIATE_TEARDOWN_TEST(Error, Resuming); | 1078 INSTANTIATE_TEARDOWN_TEST(Error, Resuming); |
1080 | 1079 |
1081 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); | 1080 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); |
1082 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended); | 1081 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended); |
1083 | 1082 |
1084 } // namespace media | 1083 } // namespace media |
OLD | NEW |