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

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

Issue 212803004: Separate DemuxerHost from DataSourceHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update other implementations of DataSourceHost and DemuxerHost. Created 6 years, 9 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
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 <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 20 matching lines...) Expand all
31 using ::testing::InvokeWithoutArgs; 31 using ::testing::InvokeWithoutArgs;
32 using ::testing::Mock; 32 using ::testing::Mock;
33 using ::testing::NotNull; 33 using ::testing::NotNull;
34 using ::testing::Return; 34 using ::testing::Return;
35 using ::testing::SaveArg; 35 using ::testing::SaveArg;
36 using ::testing::StrictMock; 36 using ::testing::StrictMock;
37 using ::testing::WithArg; 37 using ::testing::WithArg;
38 38
39 namespace media { 39 namespace media {
40 40
41 // Demuxer properties.
42 const int kTotalBytes = 1024; 41 const int kTotalBytes = 1024;
43 42
44 ACTION_P(SetDemuxerProperties, duration) { 43 ACTION_P(SetDemuxerProperties, duration) {
45 arg0->SetTotalBytes(kTotalBytes);
46 arg0->SetDuration(duration); 44 arg0->SetDuration(duration);
47 } 45 }
48 46
49 ACTION_P2(Stop, pipeline, stop_cb) { 47 ACTION_P2(Stop, pipeline, stop_cb) {
50 pipeline->Stop(stop_cb); 48 pipeline->Stop(stop_cb);
51 } 49 }
52 50
53 ACTION_P2(SetError, pipeline, status) { 51 ACTION_P2(SetError, pipeline, status) {
54 pipeline->SetErrorForTesting(status); 52 pipeline->SetErrorForTesting(status);
55 } 53 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 210
213 // Startup sequence. 211 // Startup sequence.
214 EXPECT_CALL(*audio_renderer_, Preroll(base::TimeDelta(), _)) 212 EXPECT_CALL(*audio_renderer_, Preroll(base::TimeDelta(), _))
215 .WillOnce(RunCallback<1>(PIPELINE_OK)); 213 .WillOnce(RunCallback<1>(PIPELINE_OK));
216 EXPECT_CALL(*audio_renderer_, Play(_)) 214 EXPECT_CALL(*audio_renderer_, Play(_))
217 .WillOnce(RunClosure<0>()); 215 .WillOnce(RunClosure<0>());
218 } 216 }
219 EXPECT_CALL(callbacks_, OnPrerollCompleted()); 217 EXPECT_CALL(callbacks_, OnPrerollCompleted());
220 } 218 }
221 219
220 // This is required to test the time range code now that DemuxerHost does
scherkus (not reviewing) 2014/03/28 20:54:09 nit: tell it like it and stick a big ol' "HACK: "
sandersd (OOO until July 31) 2014/03/28 21:14:28 Done.
221 // not include SetTotalBytes(). This will be removed when the DataSourceHost
222 // implementation is moved out of Pipeline.
223 DataSourceHost* host = pipeline_.get();
224 host->SetTotalBytes(kTotalBytes);
225
222 pipeline_->Start( 226 pipeline_->Start(
223 filter_collection_.Pass(), 227 filter_collection_.Pass(),
224 base::Bind(&CallbackHelper::OnEnded, base::Unretained(&callbacks_)), 228 base::Bind(&CallbackHelper::OnEnded, base::Unretained(&callbacks_)),
225 base::Bind(&CallbackHelper::OnError, base::Unretained(&callbacks_)), 229 base::Bind(&CallbackHelper::OnError, base::Unretained(&callbacks_)),
226 base::Bind(&CallbackHelper::OnStart, base::Unretained(&callbacks_)), 230 base::Bind(&CallbackHelper::OnStart, base::Unretained(&callbacks_)),
227 base::Bind(&CallbackHelper::OnMetadata, base::Unretained(&callbacks_)), 231 base::Bind(&CallbackHelper::OnMetadata, base::Unretained(&callbacks_)),
228 base::Bind(&CallbackHelper::OnPrerollCompleted, 232 base::Bind(&CallbackHelper::OnPrerollCompleted,
229 base::Unretained(&callbacks_)), 233 base::Unretained(&callbacks_)),
230 base::Bind(&CallbackHelper::OnDurationChange, 234 base::Bind(&CallbackHelper::OnDurationChange,
231 base::Unretained(&callbacks_))); 235 base::Unretained(&callbacks_)));
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); 1268 INSTANTIATE_TEARDOWN_TEST(Error, Pausing);
1265 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); 1269 INSTANTIATE_TEARDOWN_TEST(Error, Flushing);
1266 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); 1270 INSTANTIATE_TEARDOWN_TEST(Error, Seeking);
1267 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); 1271 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling);
1268 INSTANTIATE_TEARDOWN_TEST(Error, Starting); 1272 INSTANTIATE_TEARDOWN_TEST(Error, Starting);
1269 INSTANTIATE_TEARDOWN_TEST(Error, Playing); 1273 INSTANTIATE_TEARDOWN_TEST(Error, Playing);
1270 1274
1271 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); 1275 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing);
1272 1276
1273 } // namespace media 1277 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698