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

Unified Diff: media/base/pipeline_impl_unittest.cc

Issue 149123: Asynchronous initialization of media::PipelineThread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« media/base/pipeline_impl.cc ('K') | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl_unittest.cc
===================================================================
--- media/base/pipeline_impl_unittest.cc (revision 19701)
+++ media/base/pipeline_impl_unittest.cc (working copy)
@@ -200,6 +200,21 @@
EXPECT_TRUE(expected == filters_->video_renderer()->seek_time());
}
+// Try to execute Start()/Stop() on the Pipeline many times and very fast. This
+// test is trying to simulate the situation where the pipeline can get dead
+// locked very easily by quickly calling Start()/Stop().
+TEST_F(PipelineImplTest, StressTestPipelineStartStop) {
+ media::old_mocks::MockFilterConfig config;
+ const int kTimes = 1000;
+ for (int i = 0; i < kTimes; ++i) {
+ scoped_refptr<media::old_mocks::MockFilterFactory> factory =
+ new media::old_mocks::MockFilterFactory(&config);
+ media::PipelineImpl pipeline;
+ pipeline.Start(factory.get(), "", NULL);
+ pipeline.Stop();
+ }
+}
+
// TODO(ralphl): Add a unit test that makes sure that the mock audio filter
// is actually called on a SetVolume() call to the pipeline. I almost checked
// in code that broke this, but all unit tests were passing.
« media/base/pipeline_impl.cc ('K') | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698