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/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 } | 570 } |
571 | 571 |
572 void StartHashedPipelineWithMediaSource(MockMediaSource* source) { | 572 void StartHashedPipelineWithMediaSource(MockMediaSource* source) { |
573 hashing_enabled_ = true; | 573 hashing_enabled_ = true; |
574 StartPipelineWithMediaSource(source); | 574 StartPipelineWithMediaSource(source); |
575 } | 575 } |
576 | 576 |
577 void StartPipelineWithEncryptedMedia( | 577 void StartPipelineWithEncryptedMedia( |
578 MockMediaSource* source, | 578 MockMediaSource* source, |
579 FakeEncryptedMedia* encrypted_media) { | 579 FakeEncryptedMedia* encrypted_media) { |
580 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1)); | |
580 EXPECT_CALL(*this, OnMetadata(_)) | 581 EXPECT_CALL(*this, OnMetadata(_)) |
581 .Times(AtMost(1)) | 582 .Times(AtMost(1)) |
582 .WillRepeatedly(SaveArg<0>(&metadata_)); | 583 .WillRepeatedly(SaveArg<0>(&metadata_)); |
583 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) | 584 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) |
584 .Times(AtMost(1)); | 585 .Times(AtMost(1)); |
585 demuxer_ = source->GetDemuxer().Pass(); | 586 demuxer_ = source->GetDemuxer().Pass(); |
586 pipeline_->Start( | 587 pipeline_->Start( |
587 demuxer_.get(), | 588 demuxer_.get(), |
588 CreateRenderer(encrypted_media->decryptor()), | 589 CreateRenderer(encrypted_media->decryptor()), |
589 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 590 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1151 // The second video was not added, so its time has not been added. | 1152 // The second video was not added, so its time has not been added. |
1152 EXPECT_EQ(k640IsoFileDurationMs, | 1153 EXPECT_EQ(k640IsoFileDurationMs, |
1153 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 1154 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
1154 | 1155 |
1155 Play(); | 1156 Play(); |
1156 | 1157 |
1157 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); | 1158 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); |
1158 source.Abort(); | 1159 source.Abort(); |
1159 } | 1160 } |
1160 | 1161 |
1161 // Config changes from encrypted to clear are not currently supported. | 1162 // Config changes from encrypted to clear are not currently supported. |
wolenetz
2014/09/22 23:25:26
drive-by nit:
Is this comment still applicable? It
xhwang
2014/09/22 23:40:19
This comment is still accurate. On line 1186 we ex
wolenetz
2014/09/22 23:49:37
Acknowledged.
| |
1162 TEST_F(PipelineIntegrationTest, | 1163 TEST_F(PipelineIntegrationTest, |
1163 MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC) { | 1164 MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC) { |
1164 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, | 1165 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, |
1165 kAppendWholeFile); | 1166 kAppendWholeFile); |
1166 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); | 1167 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); |
1167 StartPipelineWithEncryptedMedia(&source, &encrypted_media); | 1168 StartPipelineWithEncryptedMedia(&source, &encrypted_media); |
1168 | 1169 |
1169 scoped_refptr<DecoderBuffer> second_file = | 1170 scoped_refptr<DecoderBuffer> second_file = |
1170 ReadTestDataFile("bear-1280x720-av_frag.mp4"); | 1171 ReadTestDataFile("bear-1280x720-av_frag.mp4"); |
1171 | 1172 |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1600 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 1601 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
1601 ASSERT_TRUE( | 1602 ASSERT_TRUE( |
1602 Start(GetTestDataFilePath("nonzero-start-time.webm"), PIPELINE_OK)); | 1603 Start(GetTestDataFilePath("nonzero-start-time.webm"), PIPELINE_OK)); |
1603 Play(); | 1604 Play(); |
1604 ASSERT_TRUE(WaitUntilOnEnded()); | 1605 ASSERT_TRUE(WaitUntilOnEnded()); |
1605 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 1606 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
1606 demuxer_->GetStartTime()); | 1607 demuxer_->GetStartTime()); |
1607 } | 1608 } |
1608 | 1609 |
1609 } // namespace media | 1610 } // namespace media |
OLD | NEW |