summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorkmackay <kmackay@chromium.org>2015-12-10 12:48:54 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-10 20:49:49 +0000
commit667512ff414d2864a10a549ffba666342ce231c0 (patch)
treecc4d07e4676f68a37d85b2543b9d95feae73c0d2 /chromecast
parent443df85bd8ec78c1787b50d3b4bee8f7187376d6 (diff)
downloadchromium_src-667512ff414d2864a10a549ffba666342ce231c0.zip
chromium_src-667512ff414d2864a10a549ffba666342ce231c0.tar.gz
chromium_src-667512ff414d2864a10a549ffba666342ce231c0.tar.bz2
[Chromecast] Fix media unit tests
The AudioVideoPipelineDeviceTest was not stopping the monitor loop correctly. BUG= internal b/26133365 Review URL: https://codereview.chromium.org/1504923009 Cr-Commit-Position: refs/heads/master@{#364467}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
index bd89fd2..3dcdb7da 100644
--- a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
+++ b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
@@ -148,6 +148,7 @@ class AudioVideoPipelineDeviceTest : public testing::Test {
scoped_ptr<MediaPipelineBackend> backend_;
scoped_ptr<BufferFeeder> audio_feeder_;
scoped_ptr<BufferFeeder> video_feeder_;
+ bool stopped_;
// Current media time.
base::TimeDelta pause_time_;
@@ -286,7 +287,7 @@ scoped_ptr<BufferFeeder> BufferFeeder::LoadVideo(MediaPipelineBackend* backend,
} // namespace
AudioVideoPipelineDeviceTest::AudioVideoPipelineDeviceTest()
- : pause_pattern_() {}
+ : stopped_(false), pause_pattern_() {}
AudioVideoPipelineDeviceTest::~AudioVideoPipelineDeviceTest() {}
@@ -338,6 +339,7 @@ void AudioVideoPipelineDeviceTest::ConfigureForFile(
void AudioVideoPipelineDeviceTest::Start() {
pause_time_ = base::TimeDelta();
pause_pattern_idx_ = 0;
+ stopped_ = false;
if (audio_feeder_)
audio_feeder_->Start();
@@ -355,6 +357,7 @@ void AudioVideoPipelineDeviceTest::OnEndOfStream() {
if ((!audio_feeder_ || audio_feeder_->eos()) &&
(!video_feeder_ || video_feeder_->eos())) {
bool success = backend_->Stop();
+ stopped_ = true;
ASSERT_TRUE(success);
base::MessageLoop::current()->QuitWhenIdle();
}
@@ -362,7 +365,7 @@ void AudioVideoPipelineDeviceTest::OnEndOfStream() {
void AudioVideoPipelineDeviceTest::MonitorLoop() {
// Backend is stopped, no need to monitor the loop any more.
- if (!audio_feeder_ && !video_feeder_)
+ if (stopped_)
return;
base::TimeDelta media_time =