Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Side by Side Diff: media/base/pipeline_impl_unittest.cc

Issue 2091893003: Make PipelineImpl state change tasks consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: restores avtrack currTime logic Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« media/base/pipeline_impl.cc ('K') | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000)); 892 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000));
893 893
894 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true)); 894 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true));
895 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true)); 895 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true));
896 896
897 if (state == kInitRenderer) { 897 if (state == kInitRenderer) {
898 if (stop_or_error == kStop) { 898 if (stop_or_error == kStop) {
899 EXPECT_CALL(*renderer_, Initialize(_, _, _)) 899 EXPECT_CALL(*renderer_, Initialize(_, _, _))
900 .WillOnce( 900 .WillOnce(
901 DoAll(Stop(pipeline_.get()), PostCallback<2>(PIPELINE_OK))); 901 DoAll(Stop(pipeline_.get()), PostCallback<2>(PIPELINE_OK)));
902 // Note: OnStart or OnMetadata callback are not called 902 // Note: OnStart is not callback after pipeline is stopped.
903 // after pipeline is stopped.
904 } else { 903 } else {
905 EXPECT_CALL(*renderer_, Initialize(_, _, _)) 904 EXPECT_CALL(*renderer_, Initialize(_, _, _))
906 .WillOnce(PostCallback<2>(PIPELINE_ERROR_INITIALIZATION_FAILED)); 905 .WillOnce(PostCallback<2>(PIPELINE_ERROR_INITIALIZATION_FAILED));
907 EXPECT_CALL(callbacks_, OnMetadata(_));
908 EXPECT_CALL(callbacks_, OnStart(PIPELINE_ERROR_INITIALIZATION_FAILED)); 906 EXPECT_CALL(callbacks_, OnStart(PIPELINE_ERROR_INITIALIZATION_FAILED));
909 } 907 }
910 908
909 EXPECT_CALL(callbacks_, OnMetadata(_));
911 EXPECT_CALL(*demuxer_, Stop()); 910 EXPECT_CALL(*demuxer_, Stop());
912 return; 911 return;
913 } 912 }
914 913
915 EXPECT_CALL(*renderer_, Initialize(_, _, _)) 914 EXPECT_CALL(*renderer_, Initialize(_, _, _))
916 .WillOnce( 915 .WillOnce(
917 DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK))); 916 DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK)));
918 917
919 // If we get here it's a successful initialization. 918 // If we get here it's a successful initialization.
920 EXPECT_CALL(callbacks_, OnStart(PIPELINE_OK)); 919 EXPECT_CALL(callbacks_, OnStart(PIPELINE_OK));
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); 1075 INSTANTIATE_TEARDOWN_TEST(Error, Seeking);
1077 INSTANTIATE_TEARDOWN_TEST(Error, Playing); 1076 INSTANTIATE_TEARDOWN_TEST(Error, Playing);
1078 INSTANTIATE_TEARDOWN_TEST(Error, Suspending); 1077 INSTANTIATE_TEARDOWN_TEST(Error, Suspending);
1079 INSTANTIATE_TEARDOWN_TEST(Error, Suspended); 1078 INSTANTIATE_TEARDOWN_TEST(Error, Suspended);
1080 INSTANTIATE_TEARDOWN_TEST(Error, Resuming); 1079 INSTANTIATE_TEARDOWN_TEST(Error, Resuming);
1081 1080
1082 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); 1081 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing);
1083 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended); 1082 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended);
1084 1083
1085 } // namespace media 1084 } // namespace media
OLDNEW
« media/base/pipeline_impl.cc ('K') | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698