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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "media/base/cdm_context.h" | 9 #include "media/base/cdm_context.h" |
10 #include "media/base/media_log.h" | 10 #include "media/base/media_log.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 .Times(AtMost(1)); | 114 .Times(AtMost(1)); |
115 CreateDemuxer(filename); | 115 CreateDemuxer(filename); |
116 | 116 |
117 if (cdm_context) { | 117 if (cdm_context) { |
118 EXPECT_CALL(*this, DecryptorAttached(true)); | 118 EXPECT_CALL(*this, DecryptorAttached(true)); |
119 pipeline_->SetCdm( | 119 pipeline_->SetCdm( |
120 cdm_context, base::Bind(&PipelineIntegrationTestBase::DecryptorAttached, | 120 cdm_context, base::Bind(&PipelineIntegrationTestBase::DecryptorAttached, |
121 base::Unretained(this))); | 121 base::Unretained(this))); |
122 } | 122 } |
123 | 123 |
| 124 // Should never be called as the required decryption keys for the encrypted |
| 125 // media files are provided in advance. |
| 126 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
| 127 |
124 pipeline_->Start( | 128 pipeline_->Start( |
125 demuxer_.get(), CreateRenderer(), | 129 demuxer_.get(), CreateRenderer(), |
126 base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)), | 130 base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)), |
127 base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)), | 131 base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)), |
128 base::Bind(&PipelineIntegrationTestBase::OnStatusCallback, | 132 base::Bind(&PipelineIntegrationTestBase::OnStatusCallback, |
129 base::Unretained(this)), | 133 base::Unretained(this)), |
130 base::Bind(&PipelineIntegrationTestBase::OnMetadata, | 134 base::Bind(&PipelineIntegrationTestBase::OnMetadata, |
131 base::Unretained(this)), | 135 base::Unretained(this)), |
132 base::Bind(&PipelineIntegrationTestBase::OnBufferingStateChanged, | 136 base::Bind(&PipelineIntegrationTestBase::OnBufferingStateChanged, |
133 base::Unretained(this)), | 137 base::Unretained(this)), |
134 base::Bind(&PipelineIntegrationTestBase::OnVideoFramePaint, | 138 base::Bind(&PipelineIntegrationTestBase::OnVideoFramePaint, |
135 base::Unretained(this)), | 139 base::Unretained(this)), |
136 base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack, | 140 base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack, |
137 base::Unretained(this))); | 141 base::Unretained(this)), |
| 142 base::Bind(&PipelineIntegrationTestBase::OnWaitingForDecryptionKey, |
| 143 base::Unretained(this))); |
138 message_loop_.Run(); | 144 message_loop_.Run(); |
139 return pipeline_status_; | 145 return pipeline_status_; |
140 } | 146 } |
141 | 147 |
142 PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, | 148 PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, |
143 kTestType test_type) { | 149 kTestType test_type) { |
144 hashing_enabled_ = test_type == kHashed; | 150 hashing_enabled_ = test_type == kHashed; |
145 clockless_playback_ = test_type == kClockless; | 151 clockless_playback_ = test_type == kClockless; |
146 return Start(filename); | 152 return Start(filename); |
147 } | 153 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 DCHECK(clockless_playback_); | 314 DCHECK(clockless_playback_); |
309 return clockless_audio_sink_->render_time(); | 315 return clockless_audio_sink_->render_time(); |
310 } | 316 } |
311 | 317 |
312 base::TimeTicks DummyTickClock::NowTicks() { | 318 base::TimeTicks DummyTickClock::NowTicks() { |
313 now_ += base::TimeDelta::FromSeconds(60); | 319 now_ += base::TimeDelta::FromSeconds(60); |
314 return now_; | 320 return now_; |
315 } | 321 } |
316 | 322 |
317 } // namespace media | 323 } // namespace media |
OLD | NEW |