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

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

Issue 1137323005: Don't return wall clock times when time isn't ticking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include sink_playing_. Created 5 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/audio_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback_helpers.h" 6 #include "base/callback_helpers.h"
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "media/base/audio_buffer_converter.h" 10 #include "media/base/audio_buffer_converter.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 StartTicking(); 512 StartTicking();
513 513
514 // Force underflow. 514 // Force underflow.
515 EXPECT_TRUE(ConsumeBufferedData(frames_buffered())); 515 EXPECT_TRUE(ConsumeBufferedData(frames_buffered()));
516 WaitForPendingRead(); 516 WaitForPendingRead();
517 EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING)); 517 EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING));
518 EXPECT_FALSE(ConsumeBufferedData(OutputFrames(1))); 518 EXPECT_FALSE(ConsumeBufferedData(OutputFrames(1)));
519 WaitForPendingRead(); 519 WaitForPendingRead();
520 StopTicking(); 520 StopTicking();
521 521
522 // After time stops ticking wall clock times should not be returned.
523 EXPECT_FALSE(
524 renderer_->GetWallClockTimes(std::vector<base::TimeDelta>(1), nullptr));
525
522 // We shouldn't expect another buffering state change when flushing. 526 // We shouldn't expect another buffering state change when flushing.
523 FlushDuringPendingRead(); 527 FlushDuringPendingRead();
524 } 528 }
525 529
526 TEST_F(AudioRendererImplTest, PendingRead_Flush) { 530 TEST_F(AudioRendererImplTest, PendingRead_Flush) {
527 Initialize(); 531 Initialize();
528 532
529 Preroll(); 533 Preroll();
530 StartTicking(); 534 StartTicking();
531 535
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 // Start rendering with zero playback rate. Sink should be paused until 746 // Start rendering with zero playback rate. Sink should be paused until
743 // non-zero rate is set. 747 // non-zero rate is set.
744 renderer_->SetPlaybackRate(0.0); 748 renderer_->SetPlaybackRate(0.0);
745 renderer_->StartTicking(); 749 renderer_->StartTicking();
746 EXPECT_EQ(FakeAudioRendererSink::kPaused, sink_->state()); 750 EXPECT_EQ(FakeAudioRendererSink::kPaused, sink_->state());
747 renderer_->SetPlaybackRate(1.0); 751 renderer_->SetPlaybackRate(1.0);
748 EXPECT_EQ(FakeAudioRendererSink::kPlaying, sink_->state()); 752 EXPECT_EQ(FakeAudioRendererSink::kPlaying, sink_->state());
749 } 753 }
750 754
751 } // namespace media 755 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698