OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |