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

Unified Diff: chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc

Issue 1504923009: [Chromecast] Fix media unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
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 bd89fd2f2cb525bd66c984ce412730426a1a8eed..3dcdb7daae84bd8e871ef32ec098bf82a593ee18 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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698