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/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 clockless_playback_(false), | 46 clockless_playback_(false), |
47 pipeline_(new PipelineImpl(message_loop_.task_runner(), new MediaLog())), | 47 pipeline_(new PipelineImpl(message_loop_.task_runner(), new MediaLog())), |
48 ended_(false), | 48 ended_(false), |
49 pipeline_status_(PIPELINE_OK), | 49 pipeline_status_(PIPELINE_OK), |
50 last_video_frame_format_(PIXEL_FORMAT_UNKNOWN), | 50 last_video_frame_format_(PIXEL_FORMAT_UNKNOWN), |
51 last_video_frame_color_space_(COLOR_SPACE_UNSPECIFIED) { | 51 last_video_frame_color_space_(COLOR_SPACE_UNSPECIFIED) { |
52 base::MD5Init(&md5_context_); | 52 base::MD5Init(&md5_context_); |
53 } | 53 } |
54 | 54 |
55 PipelineIntegrationTestBase::~PipelineIntegrationTestBase() { | 55 PipelineIntegrationTestBase::~PipelineIntegrationTestBase() { |
56 if (!pipeline_->IsRunning()) | 56 if (pipeline_->IsRunning()) |
57 return; | 57 Stop(); |
58 | 58 |
59 Stop(); | 59 pipeline_.reset(); |
| 60 message_loop_.RunUntilIdle(); |
60 } | 61 } |
61 | 62 |
62 // TODO(xhwang): Method definitions in this file needs to be reordered. | 63 // TODO(xhwang): Method definitions in this file needs to be reordered. |
63 | 64 |
64 void PipelineIntegrationTestBase::OnSeeked(base::TimeDelta seek_time, | 65 void PipelineIntegrationTestBase::OnSeeked(base::TimeDelta seek_time, |
65 PipelineStatus status) { | 66 PipelineStatus status) { |
66 EXPECT_EQ(seek_time, pipeline_->GetMediaTime()); | 67 EXPECT_EQ(seek_time, pipeline_->GetMediaTime()); |
67 pipeline_status_ = status; | 68 pipeline_status_ = status; |
68 } | 69 } |
69 | 70 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 DCHECK(clockless_playback_); | 382 DCHECK(clockless_playback_); |
382 return clockless_audio_sink_->render_time(); | 383 return clockless_audio_sink_->render_time(); |
383 } | 384 } |
384 | 385 |
385 base::TimeTicks DummyTickClock::NowTicks() { | 386 base::TimeTicks DummyTickClock::NowTicks() { |
386 now_ += base::TimeDelta::FromSeconds(60); | 387 now_ += base::TimeDelta::FromSeconds(60); |
387 return now_; | 388 return now_; |
388 } | 389 } |
389 | 390 |
390 } // namespace media | 391 } // namespace media |
OLD | NEW |