OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
8 #include "media/base/pipeline_impl.h" | 8 #include "media/base/pipeline_impl.h" |
9 #include "media/base/media_format.h" | 9 #include "media/base/media_format.h" |
10 #include "media/base/filters.h" | 10 #include "media/base/filters.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // TODO(scherkus): implement whatever it takes so I can use EXPECT_EQ with | 193 // TODO(scherkus): implement whatever it takes so I can use EXPECT_EQ with |
194 // base::TimeDelta. | 194 // base::TimeDelta. |
195 EXPECT_TRUE(expected == filters_->data_source()->seek_time()); | 195 EXPECT_TRUE(expected == filters_->data_source()->seek_time()); |
196 EXPECT_TRUE(expected == filters_->demuxer()->seek_time()); | 196 EXPECT_TRUE(expected == filters_->demuxer()->seek_time()); |
197 EXPECT_TRUE(expected == filters_->audio_decoder()->seek_time()); | 197 EXPECT_TRUE(expected == filters_->audio_decoder()->seek_time()); |
198 EXPECT_TRUE(expected == filters_->audio_renderer()->seek_time()); | 198 EXPECT_TRUE(expected == filters_->audio_renderer()->seek_time()); |
199 EXPECT_TRUE(expected == filters_->video_decoder()->seek_time()); | 199 EXPECT_TRUE(expected == filters_->video_decoder()->seek_time()); |
200 EXPECT_TRUE(expected == filters_->video_renderer()->seek_time()); | 200 EXPECT_TRUE(expected == filters_->video_renderer()->seek_time()); |
201 } | 201 } |
202 | 202 |
| 203 // Try to execute Start()/Stop() on the Pipeline many times and very fast. This |
| 204 // test is trying to simulate the situation where the pipeline can get dead |
| 205 // locked very easily by quickly calling Start()/Stop(). |
| 206 TEST_F(PipelineImplTest, StressTestPipelineStartStop) { |
| 207 media::old_mocks::MockFilterConfig config; |
| 208 const int kTimes = 1000; |
| 209 for (int i = 0; i < kTimes; ++i) { |
| 210 scoped_refptr<media::old_mocks::MockFilterFactory> factory = |
| 211 new media::old_mocks::MockFilterFactory(&config); |
| 212 media::PipelineImpl pipeline; |
| 213 pipeline.Start(factory.get(), "", NULL); |
| 214 pipeline.Stop(); |
| 215 } |
| 216 } |
| 217 |
203 // TODO(ralphl): Add a unit test that makes sure that the mock audio filter | 218 // TODO(ralphl): Add a unit test that makes sure that the mock audio filter |
204 // is actually called on a SetVolume() call to the pipeline. I almost checked | 219 // is actually called on a SetVolume() call to the pipeline. I almost checked |
205 // in code that broke this, but all unit tests were passing. | 220 // in code that broke this, but all unit tests were passing. |
206 | 221 |
207 } // namespace | 222 } // namespace |
OLD | NEW |