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

Side by Side Diff: media/filters/video_renderer_impl_unittest.cc

Issue 692323002: Move Liveness from DemuxerStreamProvider to DemuxerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mojo Created 6 years, 1 month 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
« no previous file with comments | « media/filters/video_renderer_impl.cc ('k') | media/formats/webm/webm_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/filters/video_renderer_impl.cc ('k') | media/formats/webm/webm_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698