Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 1152803003: Fix overloaded pipeline integration tests to support underflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/media_unittests.gtest.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 #endif 656 #endif
657 657
658 class PipelineIntegrationTest : public PipelineIntegrationTestHost { 658 class PipelineIntegrationTest : public PipelineIntegrationTestHost {
659 public: 659 public:
660 void StartPipelineWithMediaSource(MockMediaSource* source) { 660 void StartPipelineWithMediaSource(MockMediaSource* source) {
661 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1)); 661 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1));
662 EXPECT_CALL(*this, OnMetadata(_)) 662 EXPECT_CALL(*this, OnMetadata(_))
663 .Times(AtMost(1)) 663 .Times(AtMost(1))
664 .WillRepeatedly(SaveArg<0>(&metadata_)); 664 .WillRepeatedly(SaveArg<0>(&metadata_));
665 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) 665 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
666 .Times(AtMost(1)); 666 .Times(AnyNumber());
667 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING))
668 .Times(AnyNumber());
667 669
668 // Encrypted content not used, so this is never called. 670 // Encrypted content not used, so this is never called.
669 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); 671 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0);
670 672
671 demuxer_ = source->GetDemuxer().Pass(); 673 demuxer_ = source->GetDemuxer().Pass();
672 pipeline_->Start( 674 pipeline_->Start(
673 demuxer_.get(), CreateRenderer(), 675 demuxer_.get(), CreateRenderer(),
674 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), 676 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)),
675 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), 677 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)),
676 base::Bind(&PipelineIntegrationTest::OnStatusCallback, 678 base::Bind(&PipelineIntegrationTest::OnStatusCallback,
(...skipping 16 matching lines...) Expand all
693 } 695 }
694 696
695 void StartPipelineWithEncryptedMedia( 697 void StartPipelineWithEncryptedMedia(
696 MockMediaSource* source, 698 MockMediaSource* source,
697 FakeEncryptedMedia* encrypted_media) { 699 FakeEncryptedMedia* encrypted_media) {
698 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1)); 700 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1));
699 EXPECT_CALL(*this, OnMetadata(_)) 701 EXPECT_CALL(*this, OnMetadata(_))
700 .Times(AtMost(1)) 702 .Times(AtMost(1))
701 .WillRepeatedly(SaveArg<0>(&metadata_)); 703 .WillRepeatedly(SaveArg<0>(&metadata_));
702 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) 704 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
703 .Times(AtMost(1)); 705 .Times(AnyNumber());
706 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING))
707 .Times(AnyNumber());
704 EXPECT_CALL(*this, DecryptorAttached(true)); 708 EXPECT_CALL(*this, DecryptorAttached(true));
705 709
706 // Encrypted content used but keys provided in advance, so this is 710 // Encrypted content used but keys provided in advance, so this is
707 // never called. 711 // never called.
708 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); 712 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0);
709 713
710 demuxer_ = source->GetDemuxer().Pass(); 714 demuxer_ = source->GetDemuxer().Pass();
711 715
712 pipeline_->SetCdm(encrypted_media->GetCdmContext(), 716 pipeline_->SetCdm(encrypted_media->GetCdmContext(),
713 base::Bind(&PipelineIntegrationTest::DecryptorAttached, 717 base::Bind(&PipelineIntegrationTest::DecryptorAttached,
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 1741
1738 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 1742 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
1739 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 1743 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
1740 Play(); 1744 Play();
1741 ASSERT_TRUE(WaitUntilOnEnded()); 1745 ASSERT_TRUE(WaitUntilOnEnded());
1742 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 1746 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
1743 demuxer_->GetStartTime()); 1747 demuxer_->GetStartTime());
1744 } 1748 }
1745 1749
1746 } // namespace media 1750 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/media_unittests.gtest.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698