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

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

Issue 1042473002: media: VideoRendererImplTest: wait on buffering change to exit first step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | tools/valgrind/gtest_exclude/media_unittests.gtest-drmemory.txt » ('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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED, false); 483 InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED, false);
484 Destroy(); 484 Destroy();
485 } 485 }
486 486
487 TEST_F(VideoRendererImplTest, Underflow) { 487 TEST_F(VideoRendererImplTest, Underflow) {
488 Initialize(); 488 Initialize();
489 QueueFrames("0 10 20 30"); 489 QueueFrames("0 10 20 30");
490 490
491 { 491 {
492 WaitableMessageLoopEvent event; 492 WaitableMessageLoopEvent event;
493 EXPECT_CALL(mock_cb_, Display(HasTimestamp(0))) 493 EXPECT_CALL(mock_cb_, Display(HasTimestamp(0)));
494 .Times(1) 494 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH))
495 .WillOnce(RunClosure(event.GetClosure())); 495 .WillOnce(RunClosure(event.GetClosure()));
496 EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH));
497 StartPlayingFrom(0); 496 StartPlayingFrom(0);
498 event.RunAndWait(); 497 event.RunAndWait();
499 Mock::VerifyAndClearExpectations(&mock_cb_); 498 Mock::VerifyAndClearExpectations(&mock_cb_);
500 } 499 }
501 500
502 // Advance time slightly. Frames should be dropped and we should NOT signal 501 // Advance time slightly. Frames should be dropped and we should NOT signal
503 // having nothing. 502 // having nothing.
504 AdvanceTimeInMs(100); 503 AdvanceTimeInMs(100);
505 504
506 // Advance time more. Now we should signal having nothing. And put 505 // Advance time more. Now we should signal having nothing. And put
(...skipping 19 matching lines...) Expand all
526 .WillOnce(RunClosure(event.GetClosure())); 525 .WillOnce(RunClosure(event.GetClosure()));
527 SatisfyPendingReadWithEndOfStream(); 526 SatisfyPendingReadWithEndOfStream();
528 event.RunAndWait(); 527 event.RunAndWait();
529 } 528 }
530 529
531 WaitForEnded(); 530 WaitForEnded();
532 Destroy(); 531 Destroy();
533 } 532 }
534 533
535 } // namespace media 534 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/media_unittests.gtest-drmemory.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698