OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void InitializeRenderer(PipelineStatus expected, bool low_delay) { | 86 void InitializeRenderer(PipelineStatus expected, bool low_delay) { |
87 SCOPED_TRACE(base::StringPrintf("InitializeRenderer(%d)", expected)); | 87 SCOPED_TRACE(base::StringPrintf("InitializeRenderer(%d)", expected)); |
88 WaitableMessageLoopEvent event; | 88 WaitableMessageLoopEvent event; |
89 CallInitialize(event.GetPipelineStatusCB(), low_delay, expected); | 89 CallInitialize(event.GetPipelineStatusCB(), low_delay, expected); |
90 event.RunAndWaitForStatus(expected); | 90 event.RunAndWaitForStatus(expected); |
91 } | 91 } |
92 | 92 |
93 void CallInitialize(const PipelineStatusCB& status_cb, | 93 void CallInitialize(const PipelineStatusCB& status_cb, |
94 bool low_delay, | 94 bool low_delay, |
95 PipelineStatus decoder_status) { | 95 PipelineStatus decoder_status) { |
| 96 if (low_delay) |
| 97 demuxer_stream_.set_liveness(DemuxerStream::LIVENESS_LIVE); |
96 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)).WillOnce( | 98 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)).WillOnce( |
97 DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(decoder_status))); | 99 DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(decoder_status))); |
98 renderer_->Initialize( | 100 renderer_->Initialize( |
99 &demuxer_stream_, | 101 &demuxer_stream_, |
100 low_delay, | |
101 status_cb, | 102 status_cb, |
102 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, | 103 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, |
103 base::Unretained(this)), | 104 base::Unretained(this)), |
104 base::Bind(&StrictMock<MockCB>::BufferingStateChange, | 105 base::Bind(&StrictMock<MockCB>::BufferingStateChange, |
105 base::Unretained(&mock_cb_)), | 106 base::Unretained(&mock_cb_)), |
106 base::Bind(&StrictMock<MockCB>::Display, base::Unretained(&mock_cb_)), | 107 base::Bind(&StrictMock<MockCB>::Display, base::Unretained(&mock_cb_)), |
107 ended_event_.GetClosure(), | 108 ended_event_.GetClosure(), |
108 error_event_.GetPipelineStatusCB(), | 109 error_event_.GetPipelineStatusCB(), |
109 base::Bind(&VideoRendererImplTest::GetTime, base::Unretained(this))); | 110 base::Bind(&VideoRendererImplTest::GetTime, base::Unretained(this))); |
110 } | 111 } |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 .WillOnce(RunClosure(event.GetClosure())); | 498 .WillOnce(RunClosure(event.GetClosure())); |
498 SatisfyPendingReadWithEndOfStream(); | 499 SatisfyPendingReadWithEndOfStream(); |
499 event.RunAndWait(); | 500 event.RunAndWait(); |
500 } | 501 } |
501 | 502 |
502 WaitForEnded(); | 503 WaitForEnded(); |
503 Destroy(); | 504 Destroy(); |
504 } | 505 } |
505 | 506 |
506 } // namespace media | 507 } // namespace media |
OLD | NEW |