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

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

Issue 1928083002: Ignore sink start attempts when no frames are present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2717
Patch Set: Created 4 years, 7 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
« no previous file with comments | « media/renderers/video_renderer_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 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 { 330 {
331 SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING"); 331 SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING");
332 WaitableMessageLoopEvent event; 332 WaitableMessageLoopEvent event;
333 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING)) 333 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING))
334 .WillOnce(RunClosure(event.GetClosure())); 334 .WillOnce(RunClosure(event.GetClosure()));
335 AdvanceTimeInMs(30); 335 AdvanceTimeInMs(30);
336 event.RunAndWait(); 336 event.RunAndWait();
337 Mock::VerifyAndClearExpectations(&mock_cb_); 337 Mock::VerifyAndClearExpectations(&mock_cb_);
338 } 338 }
339 339
340 // Simulate delayed buffering state callbacks.
341 renderer_->OnTimeStateChanged(false);
342 renderer_->OnTimeStateChanged(true);
343
340 // Receiving end of stream should signal having enough. 344 // Receiving end of stream should signal having enough.
341 { 345 {
342 SCOPED_TRACE("Waiting for BUFFERING_HAVE_ENOUGH"); 346 SCOPED_TRACE("Waiting for BUFFERING_HAVE_ENOUGH");
343 WaitableMessageLoopEvent event; 347 WaitableMessageLoopEvent event;
344 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH)) 348 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH))
345 .WillOnce(RunClosure(event.GetClosure())); 349 .WillOnce(RunClosure(event.GetClosure()));
346 SatisfyPendingReadWithEndOfStream(); 350 SatisfyPendingReadWithEndOfStream();
347 event.RunAndWait(); 351 event.RunAndWait();
348 } 352 }
349 353
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 QueueFrames("0 10 20 30"); 896 QueueFrames("0 10 20 30");
893 StartPlayingFrom(0); 897 StartPlayingFrom(0);
894 Flush(); 898 Flush();
895 ASSERT_EQ(1u, frame_ready_cbs_.size()); 899 ASSERT_EQ(1u, frame_ready_cbs_.size());
896 // This frame will be discarded. 900 // This frame will be discarded.
897 frame_ready_cbs_.front().Run(); 901 frame_ready_cbs_.front().Run();
898 Destroy(); 902 Destroy();
899 } 903 }
900 904
901 } // namespace media 905 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/video_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698