| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 .WillRepeatedly(SaveArg<0>(&metadata_)); | 688 .WillRepeatedly(SaveArg<0>(&metadata_)); |
| 689 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) | 689 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) |
| 690 .Times(AnyNumber()); | 690 .Times(AnyNumber()); |
| 691 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING)) | 691 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING)) |
| 692 .Times(AnyNumber()); | 692 .Times(AnyNumber()); |
| 693 | 693 |
| 694 // Encrypted content not used, so this is never called. | 694 // Encrypted content not used, so this is never called. |
| 695 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); | 695 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
| 696 | 696 |
| 697 demuxer_ = source->GetDemuxer(); | 697 demuxer_ = source->GetDemuxer(); |
| 698 scoped_ptr<Renderer> renderer = CreateRenderer(); |
| 698 pipeline_->Start( | 699 pipeline_->Start( |
| 699 demuxer_.get(), CreateRenderer(), | 700 demuxer_.get(), &renderer, |
| 700 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 701 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
| 701 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 702 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
| 702 base::Bind(&PipelineIntegrationTest::OnStatusCallback, | 703 base::Bind(&PipelineIntegrationTest::OnStatusCallback, |
| 703 base::Unretained(this)), | 704 base::Unretained(this)), |
| 704 base::Bind(&PipelineIntegrationTest::OnMetadata, | 705 base::Bind(&PipelineIntegrationTest::OnMetadata, |
| 705 base::Unretained(this)), | 706 base::Unretained(this)), |
| 706 base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, | 707 base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, |
| 707 base::Unretained(this)), | 708 base::Unretained(this)), |
| 708 base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, | 709 base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, |
| 709 base::Unretained(this)), | 710 base::Unretained(this)), |
| (...skipping 25 matching lines...) Expand all Loading... |
| 735 .Times(AnyNumber()); | 736 .Times(AnyNumber()); |
| 736 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING)) | 737 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING)) |
| 737 .Times(AnyNumber()); | 738 .Times(AnyNumber()); |
| 738 EXPECT_CALL(*this, DecryptorAttached(true)); | 739 EXPECT_CALL(*this, DecryptorAttached(true)); |
| 739 | 740 |
| 740 // Encrypted content used but keys provided in advance, so this is | 741 // Encrypted content used but keys provided in advance, so this is |
| 741 // never called. | 742 // never called. |
| 742 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); | 743 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
| 743 | 744 |
| 744 demuxer_ = source->GetDemuxer(); | 745 demuxer_ = source->GetDemuxer(); |
| 746 scoped_ptr<Renderer> renderer = CreateRenderer(); |
| 745 | 747 |
| 746 pipeline_->SetCdm(encrypted_media->GetCdmContext(), | 748 pipeline_->SetCdm(encrypted_media->GetCdmContext(), |
| 747 base::Bind(&PipelineIntegrationTest::DecryptorAttached, | 749 base::Bind(&PipelineIntegrationTest::DecryptorAttached, |
| 748 base::Unretained(this))); | 750 base::Unretained(this))); |
| 749 | 751 |
| 750 pipeline_->Start( | 752 pipeline_->Start( |
| 751 demuxer_.get(), CreateRenderer(), | 753 demuxer_.get(), &renderer, |
| 752 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 754 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
| 753 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 755 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
| 754 base::Bind(&PipelineIntegrationTest::OnStatusCallback, | 756 base::Bind(&PipelineIntegrationTest::OnStatusCallback, |
| 755 base::Unretained(this)), | 757 base::Unretained(this)), |
| 756 base::Bind(&PipelineIntegrationTest::OnMetadata, | 758 base::Bind(&PipelineIntegrationTest::OnMetadata, |
| 757 base::Unretained(this)), | 759 base::Unretained(this)), |
| 758 base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, | 760 base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, |
| 759 base::Unretained(this)), | 761 base::Unretained(this)), |
| 760 base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, | 762 base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, |
| 761 base::Unretained(this)), | 763 base::Unretained(this)), |
| (...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2004 | 2006 |
| 2005 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2007 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
| 2006 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2008 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
| 2007 Play(); | 2009 Play(); |
| 2008 ASSERT_TRUE(WaitUntilOnEnded()); | 2010 ASSERT_TRUE(WaitUntilOnEnded()); |
| 2009 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2011 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
| 2010 demuxer_->GetStartTime()); | 2012 demuxer_->GetStartTime()); |
| 2011 } | 2013 } |
| 2012 | 2014 |
| 2013 } // namespace media | 2015 } // namespace media |
| OLD | NEW |