Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 #if !defined(MEDIA_DISABLE_LIBVPX) | 28 #if !defined(MEDIA_DISABLE_LIBVPX) |
| 29 #include "media/filters/vpx_video_decoder.h" | 29 #include "media/filters/vpx_video_decoder.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 using ::testing::_; | 32 using ::testing::_; |
| 33 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
| 34 using ::testing::AtLeast; | 34 using ::testing::AtLeast; |
| 35 using ::testing::AtMost; | 35 using ::testing::AtMost; |
| 36 using ::testing::Invoke; | 36 using ::testing::Invoke; |
| 37 using ::testing::InvokeWithoutArgs; | 37 using ::testing::InvokeWithoutArgs; |
| 38 using ::testing::Return; | |
| 38 using ::testing::SaveArg; | 39 using ::testing::SaveArg; |
| 39 | 40 |
| 40 namespace media { | 41 namespace media { |
| 41 | 42 |
| 42 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; | 43 const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; |
| 43 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; | 44 const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; |
| 44 | 45 |
| 45 PipelineIntegrationTestBase::PipelineIntegrationTestBase() | 46 PipelineIntegrationTestBase::PipelineIntegrationTestBase() |
| 46 : hashing_enabled_(false), | 47 : hashing_enabled_(false), |
| 47 clockless_playback_(false), | 48 clockless_playback_(false), |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING)) | 145 EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING)) |
| 145 .Times(AnyNumber()); | 146 .Times(AnyNumber()); |
| 146 // Permit at most two calls to OnDurationChange. CheckDuration will make sure | 147 // Permit at most two calls to OnDurationChange. CheckDuration will make sure |
| 147 // that no more than one of them is a finite duration. This allows the | 148 // that no more than one of them is a finite duration. This allows the |
| 148 // pipeline to call back at the end of the media with the known duration. | 149 // pipeline to call back at the end of the media with the known duration. |
| 149 EXPECT_CALL(*this, OnDurationChange()) | 150 EXPECT_CALL(*this, OnDurationChange()) |
| 150 .Times(AtMost(2)) | 151 .Times(AtMost(2)) |
| 151 .WillRepeatedly( | 152 .WillRepeatedly( |
| 152 Invoke(this, &PipelineIntegrationTestBase::CheckDuration)); | 153 Invoke(this, &PipelineIntegrationTestBase::CheckDuration)); |
| 153 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(AtMost(1)); | 154 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(AtMost(1)); |
| 154 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(AtMost(1)); | 155 EXPECT_CALL(*this, OnVideoOpacityChange(_)).WillRepeatedly(Return()); |
|
DaleCurtis
2017/01/18 18:20:31
.Times(AnyNumber()) also works.
liberato (no reviews please)
2017/01/18 18:49:29
didn't know that, thanks!
| |
| 155 CreateDemuxer(std::move(data_source)); | 156 CreateDemuxer(std::move(data_source)); |
| 156 | 157 |
| 157 if (cdm_context) { | 158 if (cdm_context) { |
| 158 EXPECT_CALL(*this, DecryptorAttached(true)); | 159 EXPECT_CALL(*this, DecryptorAttached(true)); |
| 159 pipeline_->SetCdm( | 160 pipeline_->SetCdm( |
| 160 cdm_context, base::Bind(&PipelineIntegrationTestBase::DecryptorAttached, | 161 cdm_context, base::Bind(&PipelineIntegrationTestBase::DecryptorAttached, |
| 161 base::Unretained(this))); | 162 base::Unretained(this))); |
| 162 } | 163 } |
| 163 | 164 |
| 164 // Should never be called as the required decryption keys for the encrypted | 165 // Should never be called as the required decryption keys for the encrypted |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 DCHECK(clockless_playback_); | 433 DCHECK(clockless_playback_); |
| 433 return clockless_audio_sink_->render_time(); | 434 return clockless_audio_sink_->render_time(); |
| 434 } | 435 } |
| 435 | 436 |
| 436 base::TimeTicks DummyTickClock::NowTicks() { | 437 base::TimeTicks DummyTickClock::NowTicks() { |
| 437 now_ += base::TimeDelta::FromSeconds(60); | 438 now_ += base::TimeDelta::FromSeconds(60); |
| 438 return now_; | 439 return now_; |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace media | 442 } // namespace media |
| OLD | NEW |