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

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

Issue 1591103002: Fix and enable mojo:media_pipeline_integration_apptests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « media/mojo/services/BUILD.gn ('k') | mojo/tools/data/apptests » ('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 <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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #define EXPECT_VIDEO_FORMAT_EQ(a, b) 46 #define EXPECT_VIDEO_FORMAT_EQ(a, b)
47 #define EXPECT_COLOR_SPACE_EQ(a, b) 47 #define EXPECT_COLOR_SPACE_EQ(a, b)
48 48
49 // TODO(xhwang): EME support is not complete for the mojo renderer, so all 49 // TODO(xhwang): EME support is not complete for the mojo renderer, so all
50 // encrypted tests are currently disabled. 50 // encrypted tests are currently disabled.
51 #define DISABLE_EME_TESTS 1 51 #define DISABLE_EME_TESTS 1
52 52
53 // TODO(xhwang,dalecurtis): Text tracks are not currently supported by the mojo 53 // TODO(xhwang,dalecurtis): Text tracks are not currently supported by the mojo
54 // renderer. 54 // renderer.
55 #define DISABLE_TEXT_TRACK_TESTS 1 55 #define DISABLE_TEXT_TRACK_TESTS 1
56
57 // TODO(jrummell, dalecurtis): Clockless playback does not currently work with
58 // mojo, so the tests take too long to run.
59 #define DISABLE_CLOCKLESS_TESTS 1
56 #else 60 #else
57 #define EXPECT_HASH_EQ(a, b) EXPECT_EQ(a, b) 61 #define EXPECT_HASH_EQ(a, b) EXPECT_EQ(a, b)
58 #define EXPECT_VIDEO_FORMAT_EQ(a, b) EXPECT_EQ(a, b) 62 #define EXPECT_VIDEO_FORMAT_EQ(a, b) EXPECT_EQ(a, b)
59 #define EXPECT_COLOR_SPACE_EQ(a, b) EXPECT_EQ(a, b) 63 #define EXPECT_COLOR_SPACE_EQ(a, b) EXPECT_EQ(a, b)
60 #endif 64 #endif // defined(MOJO_RENDERER)
61 65
62 using testing::_; 66 using testing::_;
63 using testing::AnyNumber; 67 using testing::AnyNumber;
64 using testing::AtLeast; 68 using testing::AtLeast;
65 using testing::AtMost; 69 using testing::AtMost;
66 using testing::SaveArg; 70 using testing::SaveArg;
67 71
68 namespace media { 72 namespace media {
69 73
70 const char kSourceId[] = "SourceId"; 74 const char kSourceId[] = "SourceId";
71 75
72 const char kWebM[] = "video/webm; codecs=\"vp8,vorbis\""; 76 const char kWebM[] = "video/webm; codecs=\"vp8,vorbis\"";
73 const char kWebMVP9[] = "video/webm; codecs=\"vp9\""; 77 const char kWebMVP9[] = "video/webm; codecs=\"vp9\"";
74 const char kAudioOnlyWebM[] = "video/webm; codecs=\"vorbis\""; 78 const char kAudioOnlyWebM[] = "video/webm; codecs=\"vorbis\"";
75 const char kOpusAudioOnlyWebM[] = "video/webm; codecs=\"opus\""; 79 const char kOpusAudioOnlyWebM[] = "video/webm; codecs=\"opus\"";
76 const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\""; 80 const char kVideoOnlyWebM[] = "video/webm; codecs=\"vp8\"";
77 #if defined(USE_PROPRIETARY_CODECS) 81 #if defined(USE_PROPRIETARY_CODECS)
78 const char kADTS[] = "audio/aac"; 82 const char kADTS[] = "audio/aac";
79 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; 83 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\"";
80 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; 84 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\"";
81 #if !defined(DISABLE_EME_TESTS)
82 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; 85 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\"";
83 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; 86 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\"";
84 #endif // !defined(DISABLE_EME_TESTS)
85 const char kMP3[] = "audio/mpeg"; 87 const char kMP3[] = "audio/mpeg";
86 #endif // defined(USE_PROPRIETARY_CODECS) 88 #endif // defined(USE_PROPRIETARY_CODECS)
87 89
88 // Key used to encrypt test files. 90 // Key used to encrypt test files.
89 const uint8_t kSecretKey[] = { 91 const uint8_t kSecretKey[] = {
90 0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b, 92 0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
91 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c 93 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c
92 }; 94 };
93 95
94 // The key ID for all encrypted files. 96 // The key ID for all encrypted files.
95 const uint8_t kKeyId[] = { 97 const uint8_t kKeyId[] = {
96 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 98 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
97 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35 99 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35
98 }; 100 };
99 101
100 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max(); 102 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max();
101 103
102 // Constants for the Media Source config change tests. 104 // Constants for the Media Source config change tests.
103 const int kAppendTimeSec = 1; 105 const int kAppendTimeSec = 1;
104 const int kAppendTimeMs = kAppendTimeSec * 1000; 106 const int kAppendTimeMs = kAppendTimeSec * 1000;
105 const int k320WebMFileDurationMs = 2736; 107 const int k320WebMFileDurationMs = 2736;
106 #if !defined(DISABLE_EME_TESTS)
107 const int k320EncWebMFileDurationMs = 2737; 108 const int k320EncWebMFileDurationMs = 2737;
108 #endif // !defined(DISABLE_EME_TESTS)
109 const int k640WebMFileDurationMs = 2749; 109 const int k640WebMFileDurationMs = 2749;
110 const int kOpusEndTrimmingWebMFileDurationMs = 2741; 110 const int kOpusEndTrimmingWebMFileDurationMs = 2741;
111 const int kVP9WebMFileDurationMs = 2736; 111 const int kVP9WebMFileDurationMs = 2736;
112 const int kVP8AWebMFileDurationMs = 2734; 112 const int kVP8AWebMFileDurationMs = 2734;
113 113
114 #if !defined(MOJO_RENDERER) 114 #if !defined(MOJO_RENDERER)
115 #if defined(OPUS_FIXED_POINT) 115 #if defined(OPUS_FIXED_POINT)
116 static const char kOpusEndTrimmingHash_1[] = 116 static const char kOpusEndTrimmingHash_1[] =
117 "-4.57,-5.68,-6.54,-6.29,-4.35,-3.59,"; 117 "-4.57,-5.68,-6.54,-6.29,-4.35,-3.59,";
118 static const char kOpusEndTrimmingHash_2[] = 118 static const char kOpusEndTrimmingHash_2[] =
119 "-11.93,-11.12,-8.27,-7.10,-7.84,-10.00,"; 119 "-11.93,-11.12,-8.27,-7.10,-7.84,-10.00,";
120 static const char kOpusEndTrimmingHash_3[] = 120 static const char kOpusEndTrimmingHash_3[] =
121 "-13.32,-14.38,-13.70,-11.69,-10.20,-10.48,"; 121 "-13.32,-14.38,-13.70,-11.69,-10.20,-10.48,";
122 #else 122 #else
123 // Hash for a full playthrough of "opus-trimming-test.(webm|ogg)". 123 // Hash for a full playthrough of "opus-trimming-test.(webm|ogg)".
124 static const char kOpusEndTrimmingHash_1[] = 124 static const char kOpusEndTrimmingHash_1[] =
125 "-4.56,-5.65,-6.51,-6.29,-4.36,-3.59,"; 125 "-4.56,-5.65,-6.51,-6.29,-4.36,-3.59,";
126 // The above hash, plus an additional playthrough starting from T=1s. 126 // The above hash, plus an additional playthrough starting from T=1s.
127 static const char kOpusEndTrimmingHash_2[] = 127 static const char kOpusEndTrimmingHash_2[] =
128 "-11.89,-11.09,-8.25,-7.11,-7.84,-9.97,"; 128 "-11.89,-11.09,-8.25,-7.11,-7.84,-9.97,";
129 // The above hash, plus an additional playthrough starting from T=6.36s. 129 // The above hash, plus an additional playthrough starting from T=6.36s.
130 static const char kOpusEndTrimmingHash_3[] = 130 static const char kOpusEndTrimmingHash_3[] =
131 "-13.28,-14.35,-13.67,-11.68,-10.18,-10.46,"; 131 "-13.28,-14.35,-13.67,-11.68,-10.18,-10.46,";
132 #endif // defined(OPUS_FIXED_POINT) 132 #endif // defined(OPUS_FIXED_POINT)
133 #endif 133 #endif // !defined(MOJO_RENDERER)
134 134
135 #if defined(USE_PROPRIETARY_CODECS) 135 #if defined(USE_PROPRIETARY_CODECS)
136 #if !defined(DISABLE_EME_TESTS)
137 const int k640IsoFileDurationMs = 2737; 136 const int k640IsoFileDurationMs = 2737;
138 const int k640IsoCencFileDurationMs = 2736; 137 const int k640IsoCencFileDurationMs = 2736;
139 #endif // !defined(DISABLE_EME_TESTS)
140 const int k1280IsoFileDurationMs = 2736; 138 const int k1280IsoFileDurationMs = 2736;
141 const int k1280IsoAVC3FileDurationMs = 2736; 139 const int k1280IsoAVC3FileDurationMs = 2736;
142 #endif // defined(USE_PROPRIETARY_CODECS) 140 #endif // defined(USE_PROPRIETARY_CODECS)
143 141
144 // Return a timeline offset for bear-320x240-live.webm. 142 // Return a timeline offset for bear-320x240-live.webm.
145 static base::Time kLiveTimelineOffset() { 143 static base::Time kLiveTimelineOffset() {
146 // The file contians the following UTC timeline offset: 144 // The file contians the following UTC timeline offset:
147 // 2012-11-10 12:34:56.789123456 145 // 2012-11-10 12:34:56.789123456
148 // Since base::Time only has a resolution of microseconds, 146 // Since base::Time only has a resolution of microseconds,
149 // construct a base::Time for 2012-11-10 12:34:56.789123. 147 // construct a base::Time for 2012-11-10 12:34:56.789123.
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 return make_scoped_ptr(new MojoRendererImpl(message_loop_.task_runner(), 668 return make_scoped_ptr(new MojoRendererImpl(message_loop_.task_runner(),
671 std::move(mojo_renderer))); 669 std::move(mojo_renderer)));
672 } 670 }
673 671
674 private: 672 private:
675 interfaces::ServiceFactoryPtr media_service_factory_; 673 interfaces::ServiceFactoryPtr media_service_factory_;
676 }; 674 };
677 #else 675 #else
678 class PipelineIntegrationTestHost : public testing::Test, 676 class PipelineIntegrationTestHost : public testing::Test,
679 public PipelineIntegrationTestBase {}; 677 public PipelineIntegrationTestBase {};
680 #endif 678 #endif // defined(MOJO_RENDERER)
681 679
682 class PipelineIntegrationTest : public PipelineIntegrationTestHost { 680 class PipelineIntegrationTest : public PipelineIntegrationTestHost {
683 public: 681 public:
684 void StartPipelineWithMediaSource(MockMediaSource* source) { 682 void StartPipelineWithMediaSource(MockMediaSource* source) {
685 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1)); 683 EXPECT_CALL(*source, InitSegmentReceived()).Times(AtLeast(1));
686 EXPECT_CALL(*this, OnMetadata(_)) 684 EXPECT_CALL(*this, OnMetadata(_))
687 .Times(AtMost(1)) 685 .Times(AtMost(1))
688 .WillRepeatedly(SaveArg<0>(&metadata_)); 686 .WillRepeatedly(SaveArg<0>(&metadata_));
689 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH)) 687 EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
690 .Times(AnyNumber()); 688 .Times(AnyNumber());
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 821
824 Play(); 822 Play();
825 823
826 ASSERT_TRUE(WaitUntilOnEnded()); 824 ASSERT_TRUE(WaitUntilOnEnded());
827 825
828 EXPECT_HASH_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash()); 826 EXPECT_HASH_EQ("f0be120a90a811506777c99a2cdf7cc1", GetVideoHash());
829 EXPECT_HASH_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash()); 827 EXPECT_HASH_EQ("-3.59,-2.06,-0.43,2.15,0.77,-0.95,", GetAudioHash());
830 EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null()); 828 EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null());
831 } 829 }
832 830
833 TEST_F(PipelineIntegrationTest, BasicPlaybackOpusOggTrimmingHashed) { 831 #if defined(DISABLE_CLOCKLESS_TESTS)
832 #define MAYBE_BasicPlaybackOpusOggTrimmingHashed \
833 DISABLED_BasicPlaybackOpusOggTrimmingHashed
834 #else
835 #define MAYBE_BasicPlaybackOpusOggTrimmingHashed \
836 BasicPlaybackOpusOggTrimmingHashed
837 #endif // defined(DISABLE_CLOCKLESS_TESTS)
xhwang 2016/01/20 05:33:35 Is it possible to wrap these defines in a macro, s
jrummell 2016/01/21 01:30:25 Done.
838 TEST_F(PipelineIntegrationTest, MAYBE_BasicPlaybackOpusOggTrimmingHashed) {
834 ASSERT_EQ(PIPELINE_OK, 839 ASSERT_EQ(PIPELINE_OK,
835 Start("opus-trimming-test.webm", kHashed | kClockless)); 840 Start("opus-trimming-test.webm", kHashed | kClockless));
836 841
837 Play(); 842 Play();
838 843
839 ASSERT_TRUE(WaitUntilOnEnded()); 844 ASSERT_TRUE(WaitUntilOnEnded());
840 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash()); 845 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash());
841 846
842 // Seek within the pre-skip section, this should not cause a beep. 847 // Seek within the pre-skip section, this should not cause a beep.
843 ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(1))); 848 ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(1)));
844 Play(); 849 Play();
845 ASSERT_TRUE(WaitUntilOnEnded()); 850 ASSERT_TRUE(WaitUntilOnEnded());
846 EXPECT_HASH_EQ(kOpusEndTrimmingHash_2, GetAudioHash()); 851 EXPECT_HASH_EQ(kOpusEndTrimmingHash_2, GetAudioHash());
847 852
848 // Seek somewhere outside of the pre-skip / end-trim section, demxuer should 853 // Seek somewhere outside of the pre-skip / end-trim section, demxuer should
849 // correctly preroll enough to accurately decode this segment. 854 // correctly preroll enough to accurately decode this segment.
850 ASSERT_TRUE(Seek(base::TimeDelta::FromMilliseconds(6360))); 855 ASSERT_TRUE(Seek(base::TimeDelta::FromMilliseconds(6360)));
851 Play(); 856 Play();
852 ASSERT_TRUE(WaitUntilOnEnded()); 857 ASSERT_TRUE(WaitUntilOnEnded());
853 EXPECT_HASH_EQ(kOpusEndTrimmingHash_3, GetAudioHash()); 858 EXPECT_HASH_EQ(kOpusEndTrimmingHash_3, GetAudioHash());
854 } 859 }
855 860
856 TEST_F(PipelineIntegrationTest, BasicPlaybackOpusWebmTrimmingHashed) { 861 #if defined(DISABLE_CLOCKLESS_TESTS)
862 #define MAYBE_BasicPlaybackOpusWebmTrimmingHashed \
863 DISABLED_BasicPlaybackOpusWebmTrimmingHashed
864 #else
865 #define MAYBE_BasicPlaybackOpusWebmTrimmingHashed \
866 BasicPlaybackOpusWebmTrimmingHashed
867 #endif // defined(DISABLE_CLOCKLESS_TESTS)
868 TEST_F(PipelineIntegrationTest, MAYBE_BasicPlaybackOpusWebmTrimmingHashed) {
857 ASSERT_EQ(PIPELINE_OK, 869 ASSERT_EQ(PIPELINE_OK,
858 Start("opus-trimming-test.webm", kHashed | kClockless)); 870 Start("opus-trimming-test.webm", kHashed | kClockless));
859 871
860 Play(); 872 Play();
861 873
862 ASSERT_TRUE(WaitUntilOnEnded()); 874 ASSERT_TRUE(WaitUntilOnEnded());
863 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash()); 875 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash());
864 876
865 // Seek within the pre-skip section, this should not cause a beep. 877 // Seek within the pre-skip section, this should not cause a beep.
866 ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(1))); 878 ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(1)));
867 Play(); 879 Play();
868 ASSERT_TRUE(WaitUntilOnEnded()); 880 ASSERT_TRUE(WaitUntilOnEnded());
869 EXPECT_HASH_EQ(kOpusEndTrimmingHash_2, GetAudioHash()); 881 EXPECT_HASH_EQ(kOpusEndTrimmingHash_2, GetAudioHash());
870 882
871 // Seek somewhere outside of the pre-skip / end-trim section, demxuer should 883 // Seek somewhere outside of the pre-skip / end-trim section, demxuer should
872 // correctly preroll enough to accurately decode this segment. 884 // correctly preroll enough to accurately decode this segment.
873 ASSERT_TRUE(Seek(base::TimeDelta::FromMilliseconds(6360))); 885 ASSERT_TRUE(Seek(base::TimeDelta::FromMilliseconds(6360)));
874 Play(); 886 Play();
875 ASSERT_TRUE(WaitUntilOnEnded()); 887 ASSERT_TRUE(WaitUntilOnEnded());
876 EXPECT_HASH_EQ(kOpusEndTrimmingHash_3, GetAudioHash()); 888 EXPECT_HASH_EQ(kOpusEndTrimmingHash_3, GetAudioHash());
877 } 889 }
878 890
891 #if defined(DISABLE_CLOCKLESS_TESTS)
892 #define MAYBE_BasicPlaybackOpusWebmTrimmingHashed_MediaSource \
893 DISABLED_BasicPlaybackOpusWebmTrimmingHashed_MediaSource
894 #else
895 #define MAYBE_BasicPlaybackOpusWebmTrimmingHashed_MediaSource \
896 BasicPlaybackOpusWebmTrimmingHashed_MediaSource
897 #endif // defined(DISABLE_CLOCKLESS_TESTS)
879 TEST_F(PipelineIntegrationTest, 898 TEST_F(PipelineIntegrationTest,
880 BasicPlaybackOpusWebmTrimmingHashed_MediaSource) { 899 MAYBE_BasicPlaybackOpusWebmTrimmingHashed_MediaSource) {
881 MockMediaSource source("opus-trimming-test.webm", kOpusAudioOnlyWebM, 900 MockMediaSource source("opus-trimming-test.webm", kOpusAudioOnlyWebM,
882 kAppendWholeFile); 901 kAppendWholeFile);
883 StartHashedClocklessPipelineWithMediaSource(&source); 902 StartHashedClocklessPipelineWithMediaSource(&source);
884 source.EndOfStream(); 903 source.EndOfStream();
885 904
886 Play(); 905 Play();
887 906
888 ASSERT_TRUE(WaitUntilOnEnded()); 907 ASSERT_TRUE(WaitUntilOnEnded());
889 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash()); 908 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash());
890 909
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 } 954 }
936 955
937 TEST_F(PipelineIntegrationTest, F32PlaybackHashed) { 956 TEST_F(PipelineIntegrationTest, F32PlaybackHashed) {
938 ASSERT_EQ(PIPELINE_OK, Start("sfx_f32le.wav", kHashed)); 957 ASSERT_EQ(PIPELINE_OK, Start("sfx_f32le.wav", kHashed));
939 Play(); 958 Play();
940 ASSERT_TRUE(WaitUntilOnEnded()); 959 ASSERT_TRUE(WaitUntilOnEnded());
941 EXPECT_HASH_EQ(std::string(kNullVideoHash), GetVideoHash()); 960 EXPECT_HASH_EQ(std::string(kNullVideoHash), GetVideoHash());
942 EXPECT_HASH_EQ("3.03,2.86,2.99,3.31,3.57,4.06,", GetAudioHash()); 961 EXPECT_HASH_EQ("3.03,2.86,2.99,3.31,3.57,4.06,", GetAudioHash());
943 } 962 }
944 963
945 #if !defined(DISABLE_EME_TESTS) 964 #if defined(DISABLE_EME_TESTS)
946 TEST_F(PipelineIntegrationTest, BasicPlaybackEncrypted) { 965 #define MAYBE_BasicPlaybackEncrypted DISABLED_BasicPlaybackEncrypted
966 #else
967 #define MAYBE_BasicPlaybackEncrypted BasicPlaybackEncrypted
968 #endif // defined(DISABLE_EME_TESTS)
969 TEST_F(PipelineIntegrationTest, MAYBE_BasicPlaybackEncrypted) {
947 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 970 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
948 set_encrypted_media_init_data_cb( 971 set_encrypted_media_init_data_cb(
949 base::Bind(&FakeEncryptedMedia::OnEncryptedMediaInitData, 972 base::Bind(&FakeEncryptedMedia::OnEncryptedMediaInitData,
950 base::Unretained(&encrypted_media))); 973 base::Unretained(&encrypted_media)));
951 974
952 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-av_enc-av.webm", 975 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-av_enc-av.webm",
953 encrypted_media.GetCdmContext())); 976 encrypted_media.GetCdmContext()));
954 977
955 Play(); 978 Play();
956 979
957 ASSERT_TRUE(WaitUntilOnEnded()); 980 ASSERT_TRUE(WaitUntilOnEnded());
958 Stop(); 981 Stop();
959 } 982 }
960 #endif // !defined(DISABLE_EME_TESTS)
961 983
962 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource) { 984 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource) {
963 MockMediaSource source("bear-320x240.webm", kWebM, 219229); 985 MockMediaSource source("bear-320x240.webm", kWebM, 219229);
964 StartPipelineWithMediaSource(&source); 986 StartPipelineWithMediaSource(&source);
965 source.EndOfStream(); 987 source.EndOfStream();
966 988
967 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 989 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
968 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 990 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
969 EXPECT_EQ(k320WebMFileDurationMs, 991 EXPECT_EQ(k320WebMFileDurationMs,
970 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 992 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 source.AppendAtTime(media_time, file->data(), file->data_size()); 1171 source.AppendAtTime(media_time, file->data(), file->data_size());
1150 buffered_ranges = pipeline_->GetBufferedTimeRanges(); 1172 buffered_ranges = pipeline_->GetBufferedTimeRanges();
1151 } while (buffered_ranges.size() == 1 && 1173 } while (buffered_ranges.size() == 1 &&
1152 buffered_ranges.start(0) == base::TimeDelta::FromSeconds(0)); 1174 buffered_ranges.start(0) == base::TimeDelta::FromSeconds(0));
1153 1175
1154 EXPECT_EQ(1u, buffered_ranges.size()); 1176 EXPECT_EQ(1u, buffered_ranges.size());
1155 source.Shutdown(); 1177 source.Shutdown();
1156 Stop(); 1178 Stop();
1157 } 1179 }
1158 1180
1159 #if !defined(DISABLE_EME_TESTS) 1181 #if defined(DISABLE_EME_TESTS)
1160 TEST_F(PipelineIntegrationTest, MediaSource_ConfigChange_Encrypted_WebM) { 1182 #define MAYBE_MediaSource_ConfigChange_Encrypted_WebM \
1183 DISABLED_MediaSource_ConfigChange_Encrypted_WebM
1184 #else
1185 #define MAYBE_MediaSource_ConfigChange_Encrypted_WebM \
1186 MediaSource_ConfigChange_Encrypted_WebM
1187 #endif // defined(DISABLE_EME_TESTS)
1188 TEST_F(PipelineIntegrationTest, MAYBE_MediaSource_ConfigChange_Encrypted_WebM) {
1161 MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM, 1189 MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM,
1162 kAppendWholeFile); 1190 kAppendWholeFile);
1163 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1191 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1164 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1192 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1165 1193
1166 scoped_refptr<DecoderBuffer> second_file = 1194 scoped_refptr<DecoderBuffer> second_file =
1167 ReadTestDataFile("bear-640x360-av_enc-av.webm"); 1195 ReadTestDataFile("bear-640x360-av_enc-av.webm");
1168 1196
1169 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1197 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1170 second_file->data(), second_file->data_size()); 1198 second_file->data(), second_file->data_size());
1171 1199
1172 source.EndOfStream(); 1200 source.EndOfStream();
1173 1201
1174 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1202 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1175 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1203 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1176 EXPECT_EQ(kAppendTimeMs + k640WebMFileDurationMs, 1204 EXPECT_EQ(kAppendTimeMs + k640WebMFileDurationMs,
1177 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1205 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1178 1206
1179 Play(); 1207 Play();
1180 1208
1181 EXPECT_TRUE(WaitUntilOnEnded()); 1209 EXPECT_TRUE(WaitUntilOnEnded());
1182 source.Shutdown(); 1210 source.Shutdown();
1183 Stop(); 1211 Stop();
1184 } 1212 }
1185 1213
1186 // Config changes from encrypted to clear are not currently supported. 1214 // Config changes from encrypted to clear are not currently supported.
1215 #if defined(DISABLE_EME_TESTS)
1216 #define MAYBE_MediaSource_ConfigChange_ClearThenEncrypted_WebM \
1217 DISABLED_MediaSource_ConfigChange_ClearThenEncrypted_WebM
1218 #else
1219 #define MAYBE_MediaSource_ConfigChange_ClearThenEncrypted_WebM \
1220 MediaSource_ConfigChange_ClearThenEncrypted_WebM
1221 #endif // defined(DISABLE_EME_TESTS)
1187 TEST_F(PipelineIntegrationTest, 1222 TEST_F(PipelineIntegrationTest,
1188 MediaSource_ConfigChange_ClearThenEncrypted_WebM) { 1223 MAYBE_MediaSource_ConfigChange_ClearThenEncrypted_WebM) {
1189 MockMediaSource source("bear-320x240-16x9-aspect.webm", kWebM, 1224 MockMediaSource source("bear-320x240-16x9-aspect.webm", kWebM,
1190 kAppendWholeFile); 1225 kAppendWholeFile);
1191 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1226 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1192 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1227 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1193 1228
1194 scoped_refptr<DecoderBuffer> second_file = 1229 scoped_refptr<DecoderBuffer> second_file =
1195 ReadTestDataFile("bear-640x360-av_enc-av.webm"); 1230 ReadTestDataFile("bear-640x360-av_enc-av.webm");
1196 1231
1197 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1232 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1198 second_file->data(), second_file->data_size()); 1233 second_file->data(), second_file->data_size());
1199 1234
1200 source.EndOfStream(); 1235 source.EndOfStream();
1201 1236
1202 message_loop_.Run(); 1237 message_loop_.Run();
1203 EXPECT_EQ(PIPELINE_ERROR_DECODE, pipeline_status_); 1238 EXPECT_EQ(PIPELINE_ERROR_DECODE, pipeline_status_);
1204 1239
1205 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1240 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1206 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1241 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1207 // The second video was not added, so its time has not been added. 1242 // The second video was not added, so its time has not been added.
1208 EXPECT_EQ(k320WebMFileDurationMs, 1243 EXPECT_EQ(k320WebMFileDurationMs,
1209 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1244 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1210 1245
1211 Play(); 1246 Play();
1212 1247
1213 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1248 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1214 source.Shutdown(); 1249 source.Shutdown();
1215 } 1250 }
1216 1251
1217 // Config changes from clear to encrypted are not currently supported. 1252 // Config changes from clear to encrypted are not currently supported.
1253 #if defined(DISABLE_EME_TESTS)
1254 #define MAYBE_MediaSource_ConfigChange_EncryptedThenClear_WebM \
1255 DISABLED_MediaSource_ConfigChange_EncryptedThenClear_WebM
1256 #else
1257 #define MAYBE_MediaSource_ConfigChange_EncryptedThenClear_WebM \
1258 MediaSource_ConfigChange_EncryptedThenClear_WebM
1259 #endif // defined(DISABLE_EME_TESTS)
1218 TEST_F(PipelineIntegrationTest, 1260 TEST_F(PipelineIntegrationTest,
1219 MediaSource_ConfigChange_EncryptedThenClear_WebM) { 1261 MAYBE_MediaSource_ConfigChange_EncryptedThenClear_WebM) {
1220 MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM, 1262 MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM,
1221 kAppendWholeFile); 1263 kAppendWholeFile);
1222 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1264 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1223 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1265 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1224 1266
1225 scoped_refptr<DecoderBuffer> second_file = 1267 scoped_refptr<DecoderBuffer> second_file =
1226 ReadTestDataFile("bear-640x360.webm"); 1268 ReadTestDataFile("bear-640x360.webm");
1227 1269
1228 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1270 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1229 second_file->data(), second_file->data_size()); 1271 second_file->data(), second_file->data_size());
1230 1272
1231 source.EndOfStream(); 1273 source.EndOfStream();
1232 1274
1233 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1275 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1234 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1276 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1235 // The second video was not added, so its time has not been added. 1277 // The second video was not added, so its time has not been added.
1236 EXPECT_EQ(k320EncWebMFileDurationMs, 1278 EXPECT_EQ(k320EncWebMFileDurationMs,
1237 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1279 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1238 1280
1239 Play(); 1281 Play();
1240 1282
1241 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1283 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1242 source.Shutdown(); 1284 source.Shutdown();
1243 } 1285 }
1244 #endif // !defined(DISABLE_EME_TESTS)
1245 1286
1246 #if defined(USE_PROPRIETARY_CODECS) 1287 #if defined(USE_PROPRIETARY_CODECS)
1247 TEST_F(PipelineIntegrationTest, MediaSource_ADTS) { 1288 TEST_F(PipelineIntegrationTest, MediaSource_ADTS) {
1248 MockMediaSource source("sfx.adts", kADTS, kAppendWholeFile); 1289 MockMediaSource source("sfx.adts", kADTS, kAppendWholeFile);
1249 StartPipelineWithMediaSource(&source); 1290 StartPipelineWithMediaSource(&source);
1250 source.EndOfStream(); 1291 source.EndOfStream();
1251 1292
1252 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1293 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1253 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1294 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1254 EXPECT_EQ(325, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1295 EXPECT_EQ(325, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 ASSERT_EQ(PIPELINE_OK, Start("sfx.mp3", kHashed)); 1336 ASSERT_EQ(PIPELINE_OK, Start("sfx.mp3", kHashed));
1296 1337
1297 Play(); 1338 Play();
1298 1339
1299 ASSERT_TRUE(WaitUntilOnEnded()); 1340 ASSERT_TRUE(WaitUntilOnEnded());
1300 1341
1301 // Verify codec delay and preroll are stripped. 1342 // Verify codec delay and preroll are stripped.
1302 EXPECT_HASH_EQ("1.30,2.72,4.56,5.08,3.74,2.03,", GetAudioHash()); 1343 EXPECT_HASH_EQ("1.30,2.72,4.56,5.08,3.74,2.03,", GetAudioHash());
1303 } 1344 }
1304 1345
1346 #if !defined(DISABLE_CLOCKLESS_TESTS)
1305 class Mp3FastSeekParams { 1347 class Mp3FastSeekParams {
1306 public: 1348 public:
1307 Mp3FastSeekParams(const char* filename, const char* hash) 1349 Mp3FastSeekParams(const char* filename, const char* hash)
1308 : filename(filename), hash(hash) {} 1350 : filename(filename), hash(hash) {}
1309 const char* filename; 1351 const char* filename;
1310 const char* hash; 1352 const char* hash;
1311 }; 1353 };
1312 1354
1313 class Mp3FastSeekIntegrationTest 1355 class Mp3FastSeekIntegrationTest
1314 : public PipelineIntegrationTest, 1356 : public PipelineIntegrationTest,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 "0.95,0.56,1.34,0.47,1.77,0.84,"))); 1395 "0.95,0.56,1.34,0.47,1.77,0.84,")));
1354 1396
1355 // VBR seeks can be fast *OR* accurate, but not both. We chose fast. 1397 // VBR seeks can be fast *OR* accurate, but not both. We chose fast.
1356 INSTANTIATE_TEST_CASE_P( 1398 INSTANTIATE_TEST_CASE_P(
1357 VBRSeeks, 1399 VBRSeeks,
1358 Mp3FastSeekIntegrationTest, 1400 Mp3FastSeekIntegrationTest,
1359 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-VBR-has-TOC.mp3", 1401 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-VBR-has-TOC.mp3",
1360 "-0.15,-0.83,0.54,1.00,1.94,0.93,"), 1402 "-0.15,-0.83,0.54,1.00,1.94,0.93,"),
1361 Mp3FastSeekParams("bear-audio-10s-VBR-no-TOC.mp3", 1403 Mp3FastSeekParams("bear-audio-10s-VBR-no-TOC.mp3",
1362 "-0.22,0.80,1.19,0.73,-0.31,-1.12,"))); 1404 "-0.22,0.80,1.19,0.73,-0.31,-1.12,")));
1405 #endif // !defined(DISABLE_CLOCKLESS_TESTS)
1363 1406
1364 TEST_F(PipelineIntegrationTest, MediaSource_MP3) { 1407 TEST_F(PipelineIntegrationTest, MediaSource_MP3) {
1365 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile); 1408 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile);
1366 StartHashedPipelineWithMediaSource(&source); 1409 StartHashedPipelineWithMediaSource(&source);
1367 source.EndOfStream(); 1410 source.EndOfStream();
1368 1411
1369 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1412 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1370 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1413 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1371 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1414 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1372 1415
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 EXPECT_EQ(kAppendTimeMs + k1280IsoFileDurationMs, 1478 EXPECT_EQ(kAppendTimeMs + k1280IsoFileDurationMs,
1436 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1479 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1437 1480
1438 Play(); 1481 Play();
1439 1482
1440 EXPECT_TRUE(WaitUntilOnEnded()); 1483 EXPECT_TRUE(WaitUntilOnEnded());
1441 source.Shutdown(); 1484 source.Shutdown();
1442 Stop(); 1485 Stop();
1443 } 1486 }
1444 1487
1445 #if !defined(DISABLE_EME_TESTS) 1488 #if defined(DISABLE_EME_TESTS)
1489 #define MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly \
1490 DISABLED_MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly
1491 #else
1492 #define MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly \
1493 MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly
1494 #endif // defined(DISABLE_EME_TESTS)
1446 TEST_F(PipelineIntegrationTest, 1495 TEST_F(PipelineIntegrationTest,
1447 MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly) { 1496 MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_VideoOnly) {
1448 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, 1497 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video,
1449 kAppendWholeFile); 1498 kAppendWholeFile);
1450 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1499 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1451 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1500 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1452 1501
1453 scoped_refptr<DecoderBuffer> second_file = 1502 scoped_refptr<DecoderBuffer> second_file =
1454 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4"); 1503 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4");
1455 1504
1456 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1505 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1457 second_file->data(), second_file->data_size()); 1506 second_file->data(), second_file->data_size());
1458 1507
1459 source.EndOfStream(); 1508 source.EndOfStream();
1460 1509
1461 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1510 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1462 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1511 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1463 EXPECT_EQ(kAppendTimeMs + k1280IsoFileDurationMs, 1512 EXPECT_EQ(kAppendTimeMs + k1280IsoFileDurationMs,
1464 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1513 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1465 1514
1466 Play(); 1515 Play();
1467 1516
1468 EXPECT_TRUE(WaitUntilOnEnded()); 1517 EXPECT_TRUE(WaitUntilOnEnded());
1469 source.Shutdown(); 1518 source.Shutdown();
1470 Stop(); 1519 Stop();
1471 } 1520 }
1472 1521
1473 TEST_F(PipelineIntegrationTest, 1522 #if defined(DISABLE_EME_TESTS)
1474 MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly) { 1523 #define MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly \
1524 DISABLED_MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly
1525 #else
1526 #define MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly \
1527 MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly
1528 #endif // defined(DISABLE_EME_TESTS)
1529 TEST_F(
1530 PipelineIntegrationTest,
1531 MAYBE_MediaSource_ConfigChange_Encrypted_MP4_CENC_KeyRotation_VideoOnly) {
1475 MockMediaSource source("bear-640x360-v_frag-cenc-key_rotation.mp4", kMP4Video, 1532 MockMediaSource source("bear-640x360-v_frag-cenc-key_rotation.mp4", kMP4Video,
1476 kAppendWholeFile); 1533 kAppendWholeFile);
1477 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp()); 1534 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp());
1478 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1535 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1479 1536
1480 scoped_refptr<DecoderBuffer> second_file = 1537 scoped_refptr<DecoderBuffer> second_file =
1481 ReadTestDataFile("bear-1280x720-v_frag-cenc-key_rotation.mp4"); 1538 ReadTestDataFile("bear-1280x720-v_frag-cenc-key_rotation.mp4");
1482 1539
1483 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1540 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1484 second_file->data(), second_file->data_size()); 1541 second_file->data(), second_file->data_size());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 EXPECT_EQ(k640IsoFileDurationMs, 1580 EXPECT_EQ(k640IsoFileDurationMs,
1524 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1581 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1525 1582
1526 Play(); 1583 Play();
1527 1584
1528 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1585 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1529 source.Shutdown(); 1586 source.Shutdown();
1530 } 1587 }
1531 1588
1532 // Config changes from encrypted to clear are not currently supported. 1589 // Config changes from encrypted to clear are not currently supported.
1590 #if defined(DISABLE_EME_TESTS)
1591 #define MAYBE_MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC \
1592 DISABLED_MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC
1593 #else
1594 #define MAYBE_MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC \
1595 MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC
1596 #endif // defined(DISABLE_EME_TESTS)
1533 TEST_F(PipelineIntegrationTest, 1597 TEST_F(PipelineIntegrationTest,
1534 MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC) { 1598 MAYBE_MediaSource_ConfigChange_EncryptedThenClear_MP4_CENC) {
1535 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, 1599 MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video,
1536 kAppendWholeFile); 1600 kAppendWholeFile);
1537 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1601 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1538 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1602 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1539 1603
1540 scoped_refptr<DecoderBuffer> second_file = 1604 scoped_refptr<DecoderBuffer> second_file =
1541 ReadTestDataFile("bear-1280x720-av_frag.mp4"); 1605 ReadTestDataFile("bear-1280x720-av_frag.mp4");
1542 1606
1543 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1607 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1544 second_file->data(), second_file->data_size()); 1608 second_file->data(), second_file->data_size());
1545 1609
1546 source.EndOfStream(); 1610 source.EndOfStream();
1547 1611
1548 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1612 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1549 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1613 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1550 // The second video was not added, so its time has not been added. 1614 // The second video was not added, so its time has not been added.
1551 EXPECT_EQ(k640IsoCencFileDurationMs, 1615 EXPECT_EQ(k640IsoCencFileDurationMs,
1552 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1616 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1553 1617
1554 Play(); 1618 Play();
1555 1619
1556 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1620 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1557 source.Shutdown(); 1621 source.Shutdown();
1558 } 1622 }
1559 #endif // !defined(DISABLE_EME_TESTS)
1560 1623
1561 // Verify files which change configuration midstream fail gracefully. 1624 // Verify files which change configuration midstream fail gracefully.
1562 TEST_F(PipelineIntegrationTest, MidStreamConfigChangesFail) { 1625 TEST_F(PipelineIntegrationTest, MidStreamConfigChangesFail) {
1563 ASSERT_EQ(PIPELINE_OK, Start("midstream_config_change.mp3")); 1626 ASSERT_EQ(PIPELINE_OK, Start("midstream_config_change.mp3"));
1564 Play(); 1627 Play();
1565 ASSERT_EQ(WaitUntilEndedOrError(), PIPELINE_ERROR_DECODE); 1628 ASSERT_EQ(WaitUntilEndedOrError(), PIPELINE_ERROR_DECODE);
1566 } 1629 }
1567 1630 #endif // defined(USE_PROPRIETARY_CODECS)
1568 #endif
1569 1631
1570 TEST_F(PipelineIntegrationTest, BasicPlayback_16x9AspectRatio) { 1632 TEST_F(PipelineIntegrationTest, BasicPlayback_16x9AspectRatio) {
1571 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-16x9-aspect.webm")); 1633 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-16x9-aspect.webm"));
1572 Play(); 1634 Play();
1573 ASSERT_TRUE(WaitUntilOnEnded()); 1635 ASSERT_TRUE(WaitUntilOnEnded());
1574 } 1636 }
1575 1637
1576 #if !defined(DISABLE_EME_TESTS) 1638 #if defined(DISABLE_EME_TESTS)
1577 TEST_F(PipelineIntegrationTest, EncryptedPlayback_WebM) { 1639 #define MAYBE_EncryptedPlayback_WebM DISABLED_EncryptedPlayback_WebM
1640 #else
1641 #define MAYBE_EncryptedPlayback_WebM EncryptedPlayback_WebM
1642 #endif // defined(DISABLE_EME_TESTS)
1643 TEST_F(PipelineIntegrationTest, MAYBE_EncryptedPlayback_WebM) {
1578 MockMediaSource source("bear-320x240-av_enc-av.webm", kWebM, 219816); 1644 MockMediaSource source("bear-320x240-av_enc-av.webm", kWebM, 219816);
1579 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1645 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1580 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1646 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1581 1647
1582 source.EndOfStream(); 1648 source.EndOfStream();
1583 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1649 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1584 1650
1585 Play(); 1651 Play();
1586 1652
1587 ASSERT_TRUE(WaitUntilOnEnded()); 1653 ASSERT_TRUE(WaitUntilOnEnded());
1588 source.Shutdown(); 1654 source.Shutdown();
1589 Stop(); 1655 Stop();
1590 } 1656 }
1591 1657
1592 TEST_F(PipelineIntegrationTest, EncryptedPlayback_ClearStart_WebM) { 1658 #if defined(DISABLE_EME_TESTS)
1659 #define MAYBE_EncryptedPlayback_ClearStart_WebM \
1660 DISABLED_EncryptedPlayback_ClearStart_WebM
1661 #else
1662 #define MAYBE_EncryptedPlayback_ClearStart_WebM \
1663 EncryptedPlayback_ClearStart_WebM
1664 #endif // defined(DISABLE_EME_TESTS)
1665 TEST_F(PipelineIntegrationTest, MAYBE_EncryptedPlayback_ClearStart_WebM) {
1593 MockMediaSource source("bear-320x240-av_enc-av_clear-1s.webm", kWebM, 1666 MockMediaSource source("bear-320x240-av_enc-av_clear-1s.webm", kWebM,
1594 kAppendWholeFile); 1667 kAppendWholeFile);
1595 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1668 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1596 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1669 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1597 1670
1598 source.EndOfStream(); 1671 source.EndOfStream();
1599 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1672 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1600 1673
1601 Play(); 1674 Play();
1602 1675
1603 ASSERT_TRUE(WaitUntilOnEnded()); 1676 ASSERT_TRUE(WaitUntilOnEnded());
1604 source.Shutdown(); 1677 source.Shutdown();
1605 Stop(); 1678 Stop();
1606 } 1679 }
1607 1680
1608 TEST_F(PipelineIntegrationTest, EncryptedPlayback_NoEncryptedFrames_WebM) { 1681 #if defined(DISABLE_EME_TESTS)
1682 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_WebM \
1683 DISABLED_EncryptedPlayback_NoEncryptedFrames_WebM
1684 #else
1685 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_WebM \
1686 EncryptedPlayback_NoEncryptedFrames_WebM
1687 #endif // defined(DISABLE_EME_TESTS)
1688 TEST_F(PipelineIntegrationTest,
1689 MAYBE_EncryptedPlayback_NoEncryptedFrames_WebM) {
1609 MockMediaSource source("bear-320x240-av_enc-av_clear-all.webm", kWebM, 1690 MockMediaSource source("bear-320x240-av_enc-av_clear-all.webm", kWebM,
1610 kAppendWholeFile); 1691 kAppendWholeFile);
1611 FakeEncryptedMedia encrypted_media(new NoResponseApp()); 1692 FakeEncryptedMedia encrypted_media(new NoResponseApp());
1612 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1693 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1613 1694
1614 source.EndOfStream(); 1695 source.EndOfStream();
1615 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1696 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1616 1697
1617 Play(); 1698 Play();
1618 1699
1619 ASSERT_TRUE(WaitUntilOnEnded()); 1700 ASSERT_TRUE(WaitUntilOnEnded());
1620 source.Shutdown(); 1701 source.Shutdown();
1621 Stop(); 1702 Stop();
1622 } 1703 }
1623 #endif // !defined(DISABLE_EME_TESTS)
1624 1704
1625 #if defined(USE_PROPRIETARY_CODECS) 1705 #if defined(USE_PROPRIETARY_CODECS)
1626 #if !defined(DISABLE_EME_TESTS) 1706 #if defined(DISABLE_EME_TESTS)
1627 TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_VideoOnly) { 1707 #define MAYBE_EncryptedPlayback_MP4_CENC_VideoOnly \
1708 DISABLED_EncryptedPlayback_MP4_CENC_VideoOnly
1709 #else
1710 #define MAYBE_EncryptedPlayback_MP4_CENC_VideoOnly \
1711 EncryptedPlayback_MP4_CENC_VideoOnly
1712 #endif // defined(DISABLE_EME_TESTS)
1713 TEST_F(PipelineIntegrationTest, MAYBE_EncryptedPlayback_MP4_CENC_VideoOnly) {
1628 MockMediaSource source("bear-1280x720-v_frag-cenc.mp4", kMP4Video, 1714 MockMediaSource source("bear-1280x720-v_frag-cenc.mp4", kMP4Video,
1629 kAppendWholeFile); 1715 kAppendWholeFile);
1630 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1716 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1631 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1717 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1632 1718
1633 source.EndOfStream(); 1719 source.EndOfStream();
1634 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1720 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1635 1721
1636 Play(); 1722 Play();
1637 1723
1638 ASSERT_TRUE(WaitUntilOnEnded()); 1724 ASSERT_TRUE(WaitUntilOnEnded());
1639 source.Shutdown(); 1725 source.Shutdown();
1640 Stop(); 1726 Stop();
1641 } 1727 }
1642 1728
1643 TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_AudioOnly) { 1729 #if defined(DISABLE_EME_TESTS)
1730 #define MAYBE_EncryptedPlayback_MP4_CENC_AudioOnly \
1731 DISABLED_EncryptedPlayback_MP4_CENC_AudioOnly
1732 #else
1733 #define MAYBE_EncryptedPlayback_MP4_CENC_AudioOnly \
1734 EncryptedPlayback_MP4_CENC_AudioOnly
1735 #endif // defined(DISABLE_EME_TESTS)
1736 TEST_F(PipelineIntegrationTest, MAYBE_EncryptedPlayback_MP4_CENC_AudioOnly) {
1644 MockMediaSource source("bear-1280x720-a_frag-cenc.mp4", kMP4Audio, 1737 MockMediaSource source("bear-1280x720-a_frag-cenc.mp4", kMP4Audio,
1645 kAppendWholeFile); 1738 kAppendWholeFile);
1646 FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); 1739 FakeEncryptedMedia encrypted_media(new KeyProvidingApp());
1647 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1740 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1648 1741
1649 source.EndOfStream(); 1742 source.EndOfStream();
1650 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1743 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1651 1744
1652 Play(); 1745 Play();
1653 1746
1654 ASSERT_TRUE(WaitUntilOnEnded()); 1747 ASSERT_TRUE(WaitUntilOnEnded());
1655 source.Shutdown(); 1748 source.Shutdown();
1656 Stop(); 1749 Stop();
1657 } 1750 }
1658 1751
1752 #if defined(DISABLE_EME_TESTS)
1753 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly \
1754 DISABLED_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly
1755 #else
1756 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly \
1757 EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly
1758 #endif // defined(DISABLE_EME_TESTS)
1659 TEST_F(PipelineIntegrationTest, 1759 TEST_F(PipelineIntegrationTest,
1660 EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly) { 1760 MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_VideoOnly) {
1661 MockMediaSource source("bear-1280x720-v_frag-cenc_clear-all.mp4", kMP4Video, 1761 MockMediaSource source("bear-1280x720-v_frag-cenc_clear-all.mp4", kMP4Video,
1662 kAppendWholeFile); 1762 kAppendWholeFile);
1663 FakeEncryptedMedia encrypted_media(new NoResponseApp()); 1763 FakeEncryptedMedia encrypted_media(new NoResponseApp());
1664 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1764 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1665 1765
1666 source.EndOfStream(); 1766 source.EndOfStream();
1667 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1767 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1668 1768
1669 Play(); 1769 Play();
1670 1770
1671 ASSERT_TRUE(WaitUntilOnEnded()); 1771 ASSERT_TRUE(WaitUntilOnEnded());
1672 source.Shutdown(); 1772 source.Shutdown();
1673 Stop(); 1773 Stop();
1674 } 1774 }
1675 1775
1776 #if defined(DISABLE_EME_TESTS)
1777 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly \
1778 DISABLED_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly
1779 #else
1780 #define MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly \
1781 EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly
1782 #endif // defined(DISABLE_EME_TESTS)
1676 TEST_F(PipelineIntegrationTest, 1783 TEST_F(PipelineIntegrationTest,
1677 EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly) { 1784 MAYBE_EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly) {
1678 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio, 1785 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio,
1679 kAppendWholeFile); 1786 kAppendWholeFile);
1680 FakeEncryptedMedia encrypted_media(new NoResponseApp()); 1787 FakeEncryptedMedia encrypted_media(new NoResponseApp());
1681 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1788 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1682 1789
1683 source.EndOfStream(); 1790 source.EndOfStream();
1684 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1791 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1685 1792
1686 Play(); 1793 Play();
1687 1794
1688 ASSERT_TRUE(WaitUntilOnEnded()); 1795 ASSERT_TRUE(WaitUntilOnEnded());
1689 source.Shutdown(); 1796 source.Shutdown();
1690 Stop(); 1797 Stop();
1691 } 1798 }
1692 1799
1693 TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_KeyRotation_Video) { 1800 #if defined(DISABLE_EME_TESTS)
1801 #define MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Video \
1802 DISABLED_EncryptedPlayback_MP4_CENC_KeyRotation_Video
1803 #else
1804 #define MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Video \
1805 EncryptedPlayback_MP4_CENC_KeyRotation_Video
1806 #endif // defined(DISABLE_EME_TESTS)
1807 TEST_F(PipelineIntegrationTest,
1808 MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Video) {
1694 MockMediaSource source("bear-1280x720-v_frag-cenc-key_rotation.mp4", 1809 MockMediaSource source("bear-1280x720-v_frag-cenc-key_rotation.mp4",
1695 kMP4Video, kAppendWholeFile); 1810 kMP4Video, kAppendWholeFile);
1696 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp()); 1811 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp());
1697 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1812 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1698 1813
1699 source.EndOfStream(); 1814 source.EndOfStream();
1700 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1815 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1701 1816
1702 Play(); 1817 Play();
1703 1818
1704 ASSERT_TRUE(WaitUntilOnEnded()); 1819 ASSERT_TRUE(WaitUntilOnEnded());
1705 source.Shutdown(); 1820 source.Shutdown();
1706 Stop(); 1821 Stop();
1707 } 1822 }
1708 1823
1709 TEST_F(PipelineIntegrationTest, EncryptedPlayback_MP4_CENC_KeyRotation_Audio) { 1824 #if defined(DISABLE_EME_TESTS)
1825 #define MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Audio \
1826 DISABLED_EncryptedPlayback_MP4_CENC_KeyRotation_Audio
1827 #else
1828 #define MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Audio \
1829 EncryptedPlayback_MP4_CENC_KeyRotation_Audio
1830 #endif // defined(DISABLE_EME_TESTS)
1831 TEST_F(PipelineIntegrationTest,
1832 MAYBE_EncryptedPlayback_MP4_CENC_KeyRotation_Audio) {
1710 MockMediaSource source("bear-1280x720-a_frag-cenc-key_rotation.mp4", 1833 MockMediaSource source("bear-1280x720-a_frag-cenc-key_rotation.mp4",
1711 kMP4Audio, kAppendWholeFile); 1834 kMP4Audio, kAppendWholeFile);
1712 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp()); 1835 FakeEncryptedMedia encrypted_media(new RotatingKeyProvidingApp());
1713 StartPipelineWithEncryptedMedia(&source, &encrypted_media); 1836 StartPipelineWithEncryptedMedia(&source, &encrypted_media);
1714 1837
1715 source.EndOfStream(); 1838 source.EndOfStream();
1716 ASSERT_EQ(PIPELINE_OK, pipeline_status_); 1839 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
1717 1840
1718 Play(); 1841 Play();
1719 1842
1720 ASSERT_TRUE(WaitUntilOnEnded()); 1843 ASSERT_TRUE(WaitUntilOnEnded());
1721 source.Shutdown(); 1844 source.Shutdown();
1722 Stop(); 1845 Stop();
1723 } 1846 }
1724 #endif // !defined(DISABLE_EME_TESTS)
1725 1847
1726 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_AVC3) { 1848 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VideoOnly_MP4_AVC3) {
1727 MockMediaSource source("bear-1280x720-v_frag-avc3.mp4", kMP4VideoAVC3, 1849 MockMediaSource source("bear-1280x720-v_frag-avc3.mp4", kMP4VideoAVC3,
1728 kAppendWholeFile); 1850 kAppendWholeFile);
1729 StartPipelineWithMediaSource(&source); 1851 StartPipelineWithMediaSource(&source);
1730 source.EndOfStream(); 1852 source.EndOfStream();
1731 1853
1732 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1854 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1733 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1855 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1734 EXPECT_EQ(k1280IsoAVC3FileDurationMs, 1856 EXPECT_EQ(k1280IsoAVC3FileDurationMs,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 1951
1830 TEST_F(PipelineIntegrationTest, Rotated_Metadata_180) { 1952 TEST_F(PipelineIntegrationTest, Rotated_Metadata_180) {
1831 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_180.mp4")); 1953 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_180.mp4"));
1832 ASSERT_EQ(VIDEO_ROTATION_180, metadata_.video_rotation); 1954 ASSERT_EQ(VIDEO_ROTATION_180, metadata_.video_rotation);
1833 } 1955 }
1834 1956
1835 TEST_F(PipelineIntegrationTest, Rotated_Metadata_270) { 1957 TEST_F(PipelineIntegrationTest, Rotated_Metadata_270) {
1836 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_270.mp4")); 1958 ASSERT_EQ(PIPELINE_OK, Start("bear_rotate_270.mp4"));
1837 ASSERT_EQ(VIDEO_ROTATION_270, metadata_.video_rotation); 1959 ASSERT_EQ(VIDEO_ROTATION_270, metadata_.video_rotation);
1838 } 1960 }
1839 #endif 1961 #endif // defined(USE_PROPRIETARY_CODECS)
1840 1962
1841 // Verify audio decoder & renderer can handle aborted demuxer reads. 1963 // Verify audio decoder & renderer can handle aborted demuxer reads.
1842 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) { 1964 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) {
1843 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", kAudioOnlyWebM, 1965 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", kAudioOnlyWebM,
1844 16384, 1966 16384,
1845 base::TimeDelta::FromMilliseconds(464), 1967 base::TimeDelta::FromMilliseconds(464),
1846 base::TimeDelta::FromMilliseconds(617), 1968 base::TimeDelta::FromMilliseconds(617),
1847 0x10CA, 19730)); 1969 0x10CA, 19730));
1848 } 1970 }
1849 1971
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 2126
2005 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2127 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2006 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2128 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2007 Play(); 2129 Play();
2008 ASSERT_TRUE(WaitUntilOnEnded()); 2130 ASSERT_TRUE(WaitUntilOnEnded());
2009 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2131 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2010 demuxer_->GetStartTime()); 2132 demuxer_->GetStartTime());
2011 } 2133 }
2012 2134
2013 } // namespace media 2135 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | mojo/tools/data/apptests » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698