| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void InitializeRenderer(PipelineStatus expected, bool low_delay) { | 87 void InitializeRenderer(PipelineStatus expected, bool low_delay) { |
| 88 SCOPED_TRACE(base::StringPrintf("InitializeRenderer(%d)", expected)); | 88 SCOPED_TRACE(base::StringPrintf("InitializeRenderer(%d)", expected)); |
| 89 WaitableMessageLoopEvent event; | 89 WaitableMessageLoopEvent event; |
| 90 CallInitialize(event.GetPipelineStatusCB(), low_delay, expected); | 90 CallInitialize(event.GetPipelineStatusCB(), low_delay, expected); |
| 91 event.RunAndWaitForStatus(expected); | 91 event.RunAndWaitForStatus(expected); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void CallInitialize(const PipelineStatusCB& status_cb, | 94 void CallInitialize(const PipelineStatusCB& status_cb, |
| 95 bool low_delay, | 95 bool low_delay, |
| 96 PipelineStatus decoder_status) { | 96 PipelineStatus decoder_status) { |
| 97 if (low_delay) |
| 98 demuxer_stream_.set_liveness(DemuxerStream::LIVENESS_LIVE); |
| 97 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)).WillOnce( | 99 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)).WillOnce( |
| 98 DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(decoder_status))); | 100 DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(decoder_status))); |
| 99 renderer_->Initialize( | 101 renderer_->Initialize( |
| 100 &demuxer_stream_, | 102 &demuxer_stream_, |
| 101 low_delay, | |
| 102 status_cb, | 103 status_cb, |
| 103 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, | 104 base::Bind(&VideoRendererImplTest::OnStatisticsUpdate, |
| 104 base::Unretained(this)), | 105 base::Unretained(this)), |
| 105 base::Bind(&StrictMock<MockCB>::BufferingStateChange, | 106 base::Bind(&StrictMock<MockCB>::BufferingStateChange, |
| 106 base::Unretained(&mock_cb_)), | 107 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 } |
| 111 | 112 |
| (...skipping 385 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 |