| 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 "media/test/pipeline_integration_test_base.h" | 5 #include "media/test/pipeline_integration_test_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 message_loop_.Run(); | 221 message_loop_.Run(); |
| 222 return (pipeline_status_ == PIPELINE_OK); | 222 return (pipeline_status_ == PIPELINE_OK); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void PipelineIntegrationTestBase::Stop() { | 225 void PipelineIntegrationTestBase::Stop() { |
| 226 DCHECK(pipeline_->IsRunning()); | 226 DCHECK(pipeline_->IsRunning()); |
| 227 pipeline_->Stop(base::MessageLoop::QuitWhenIdleClosure()); | 227 pipeline_->Stop(base::MessageLoop::QuitWhenIdleClosure()); |
| 228 message_loop_.Run(); | 228 message_loop_.Run(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void PipelineIntegrationTestBase::FailTest(PipelineStatus status) { |
| 232 DCHECK_NE(PIPELINE_OK, status); |
| 233 OnError(status); |
| 234 } |
| 235 |
| 231 void PipelineIntegrationTestBase::QuitAfterCurrentTimeTask( | 236 void PipelineIntegrationTestBase::QuitAfterCurrentTimeTask( |
| 232 const base::TimeDelta& quit_time) { | 237 const base::TimeDelta& quit_time) { |
| 233 if (pipeline_->GetMediaTime() >= quit_time || | 238 if (pipeline_->GetMediaTime() >= quit_time || |
| 234 pipeline_status_ != PIPELINE_OK) { | 239 pipeline_status_ != PIPELINE_OK) { |
| 235 message_loop_.QuitWhenIdle(); | 240 message_loop_.QuitWhenIdle(); |
| 236 return; | 241 return; |
| 237 } | 242 } |
| 238 | 243 |
| 239 message_loop_.PostDelayedTask( | 244 message_loop_.PostDelayedTask( |
| 240 FROM_HERE, | 245 FROM_HERE, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 DCHECK(clockless_playback_); | 378 DCHECK(clockless_playback_); |
| 374 return clockless_audio_sink_->render_time(); | 379 return clockless_audio_sink_->render_time(); |
| 375 } | 380 } |
| 376 | 381 |
| 377 base::TimeTicks DummyTickClock::NowTicks() { | 382 base::TimeTicks DummyTickClock::NowTicks() { |
| 378 now_ += base::TimeDelta::FromSeconds(60); | 383 now_ += base::TimeDelta::FromSeconds(60); |
| 379 return now_; | 384 return now_; |
| 380 } | 385 } |
| 381 | 386 |
| 382 } // namespace media | 387 } // namespace media |
| OLD | NEW |