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 // |
| 5 // Regression tests for FFmpeg. Security test files can be found in the |
| 6 // internal media test data directory: |
| 7 // |
| 8 // svn://svn.chromium.org/chrome-internal/trunk/data/media/security/ |
| 9 // |
| 10 // Simply add the custom_dep below to your gclient and sync: |
| 11 // |
| 12 // "src/media/test/data/security": |
| 13 // "svn://chrome-svn/chrome-internal/trunk/data/media/security" |
| 14 // |
| 15 // Many of the files here do not cause issues outside of tooling, so you'll need |
| 16 // to run this test under ASAN, TSAN, and Valgrind to ensure that all issues are |
| 17 // caught. |
4 | 18 |
5 #include "media/filters/pipeline_integration_test_base.h" | 19 #include "media/filters/pipeline_integration_test_base.h" |
6 | 20 |
7 #include "base/bind.h" | 21 #include "base/bind.h" |
8 #include "media/base/test_data_util.h" | 22 #include "media/base/test_data_util.h" |
9 #include "media/filters/chunk_demuxer_client.h" | 23 #include "media/filters/chunk_demuxer_client.h" |
10 | 24 |
11 namespace media { | 25 namespace media { |
12 | 26 |
13 struct RegressionTestData { | 27 struct RegressionTestData { |
(...skipping 15 matching lines...) Expand all Loading... |
29 }; | 43 }; |
30 | 44 |
31 #define FFMPEG_TEST_CASE(name, fn, init_status, end_status) \ | 45 #define FFMPEG_TEST_CASE(name, fn, init_status, end_status) \ |
32 INSTANTIATE_TEST_CASE_P(name, FFmpegRegressionTest, \ | 46 INSTANTIATE_TEST_CASE_P(name, FFmpegRegressionTest, \ |
33 testing::Values(RegressionTestData(fn, \ | 47 testing::Values(RegressionTestData(fn, \ |
34 init_status, \ | 48 init_status, \ |
35 end_status))); | 49 end_status))); |
36 | 50 |
37 // Test cases from issues. | 51 // Test cases from issues. |
38 FFMPEG_TEST_CASE(Cr93620, "security/93620.ogg", PIPELINE_OK, PIPELINE_OK); | 52 FFMPEG_TEST_CASE(Cr93620, "security/93620.ogg", PIPELINE_OK, PIPELINE_OK); |
39 FFMPEG_TEST_CASE(Cr99652, "security/99652.webm", PIPELINE_OK, | |
40 PIPELINE_ERROR_DECODE); | |
41 FFMPEG_TEST_CASE(Cr100492, "security/100492.webm", DECODER_ERROR_NOT_SUPPORTED, | 53 FFMPEG_TEST_CASE(Cr100492, "security/100492.webm", DECODER_ERROR_NOT_SUPPORTED, |
42 DECODER_ERROR_NOT_SUPPORTED); | 54 DECODER_ERROR_NOT_SUPPORTED); |
43 FFMPEG_TEST_CASE(Cr100543, "security/100543.webm", PIPELINE_OK, PIPELINE_OK); | 55 FFMPEG_TEST_CASE(Cr100543, "security/100543.webm", PIPELINE_OK, PIPELINE_OK); |
44 FFMPEG_TEST_CASE(Cr101458, "security/101458.webm", DECODER_ERROR_NOT_SUPPORTED, | 56 FFMPEG_TEST_CASE(Cr101458, "security/101458.webm", DECODER_ERROR_NOT_SUPPORTED, |
45 DECODER_ERROR_NOT_SUPPORTED); | 57 DECODER_ERROR_NOT_SUPPORTED); |
46 FFMPEG_TEST_CASE(Cr108416, "security/108416.webm", PIPELINE_OK, PIPELINE_OK); | 58 FFMPEG_TEST_CASE(Cr108416, "security/108416.webm", PIPELINE_OK, PIPELINE_OK); |
47 FFMPEG_TEST_CASE(Cr110849, "security/110849.mkv", DEMUXER_ERROR_COULD_NOT_PARSE, | 59 FFMPEG_TEST_CASE(Cr110849, "security/110849.mkv", DEMUXER_ERROR_COULD_NOT_PARSE, |
48 DEMUXER_ERROR_COULD_NOT_PARSE); | 60 DEMUXER_ERROR_COULD_NOT_PARSE); |
49 FFMPEG_TEST_CASE(Cr112384, "security/112384.webm", | 61 FFMPEG_TEST_CASE(Cr112384, "security/112384.webm", |
50 DEMUXER_ERROR_COULD_NOT_PARSE, DEMUXER_ERROR_COULD_NOT_PARSE); | 62 DEMUXER_ERROR_COULD_NOT_PARSE, DEMUXER_ERROR_COULD_NOT_PARSE); |
(...skipping 14 matching lines...) Expand all Loading... |
65 FFMPEG_TEST_CASE(MP4_6, "security/clockh264aac_344289.mp4", PIPELINE_OK, | 77 FFMPEG_TEST_CASE(MP4_6, "security/clockh264aac_344289.mp4", PIPELINE_OK, |
66 PIPELINE_OK); | 78 PIPELINE_OK); |
67 FFMPEG_TEST_CASE(MP4_7, "security/clockh264mp3_187697.mp4", PIPELINE_OK, | 79 FFMPEG_TEST_CASE(MP4_7, "security/clockh264mp3_187697.mp4", PIPELINE_OK, |
68 PIPELINE_OK); | 80 PIPELINE_OK); |
69 FFMPEG_TEST_CASE(MP4_8, "security/h264.705767.mp4", PIPELINE_ERROR_DECODE, | 81 FFMPEG_TEST_CASE(MP4_8, "security/h264.705767.mp4", PIPELINE_ERROR_DECODE, |
70 PIPELINE_ERROR_DECODE); | 82 PIPELINE_ERROR_DECODE); |
71 FFMPEG_TEST_CASE(MP4_9, "security/smclockmp4aac_1_0.mp4", | 83 FFMPEG_TEST_CASE(MP4_9, "security/smclockmp4aac_1_0.mp4", |
72 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN); | 84 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN); |
73 | 85 |
74 // General OGV test cases. | 86 // General OGV test cases. |
75 FFMPEG_TEST_CASE(OGV_0, "security/big_dims.ogv", PIPELINE_ERROR_DECODE, | |
76 PIPELINE_ERROR_DECODE); | |
77 FFMPEG_TEST_CASE(OGV_1, "security/out.163.ogv", DECODER_ERROR_NOT_SUPPORTED, | 87 FFMPEG_TEST_CASE(OGV_1, "security/out.163.ogv", DECODER_ERROR_NOT_SUPPORTED, |
78 DECODER_ERROR_NOT_SUPPORTED); | 88 DECODER_ERROR_NOT_SUPPORTED); |
79 FFMPEG_TEST_CASE(OGV_2, "security/out.391.ogv", DECODER_ERROR_NOT_SUPPORTED, | 89 FFMPEG_TEST_CASE(OGV_2, "security/out.391.ogv", DECODER_ERROR_NOT_SUPPORTED, |
80 DECODER_ERROR_NOT_SUPPORTED); | 90 DECODER_ERROR_NOT_SUPPORTED); |
81 FFMPEG_TEST_CASE(OGV_3, "security/smclock_1_0.ogv", PIPELINE_OK, PIPELINE_OK); | |
82 FFMPEG_TEST_CASE(OGV_4, "security/smclock.ogv.1.0.ogv", PIPELINE_OK, | |
83 PIPELINE_OK); | |
84 FFMPEG_TEST_CASE(OGV_5, "security/smclocktheora_1_0.ogv", | 91 FFMPEG_TEST_CASE(OGV_5, "security/smclocktheora_1_0.ogv", |
85 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 92 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
86 FFMPEG_TEST_CASE(OGV_6, "security/smclocktheora_1_10000.ogv", | |
87 PIPELINE_ERROR_DECODE, PIPELINE_ERROR_DECODE); | |
88 FFMPEG_TEST_CASE(OGV_7, "security/smclocktheora_1_102.ogv", | 93 FFMPEG_TEST_CASE(OGV_7, "security/smclocktheora_1_102.ogv", |
89 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 94 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
90 FFMPEG_TEST_CASE(OGV_8, "security/smclocktheora_1_104.ogv", | 95 FFMPEG_TEST_CASE(OGV_8, "security/smclocktheora_1_104.ogv", |
91 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 96 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
92 FFMPEG_TEST_CASE(OGV_9, "security/smclocktheora_1_110.ogv", | 97 FFMPEG_TEST_CASE(OGV_9, "security/smclocktheora_1_110.ogv", |
93 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 98 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
94 FFMPEG_TEST_CASE(OGV_10, "security/smclocktheora_1_179.ogv", | 99 FFMPEG_TEST_CASE(OGV_10, "security/smclocktheora_1_179.ogv", |
95 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 100 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
96 FFMPEG_TEST_CASE(OGV_11, "security/smclocktheora_1_20.ogv", | 101 FFMPEG_TEST_CASE(OGV_11, "security/smclocktheora_1_20.ogv", |
97 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 102 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
98 FFMPEG_TEST_CASE(OGV_12, "security/smclocktheora_1_723.ogv", | 103 FFMPEG_TEST_CASE(OGV_12, "security/smclocktheora_1_723.ogv", |
99 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 104 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
100 FFMPEG_TEST_CASE(OGV_13, "security/smclocktheora_1_790.ogv", PIPELINE_OK, | |
101 PIPELINE_OK); | |
102 FFMPEG_TEST_CASE(OGV_14, "security/smclocktheora_2_10405.ogv", | 105 FFMPEG_TEST_CASE(OGV_14, "security/smclocktheora_2_10405.ogv", |
103 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 106 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
| 107 FFMPEG_TEST_CASE(OGV_15, "security/smclocktheora_2_10619.ogv", |
| 108 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
104 FFMPEG_TEST_CASE(OGV_16, "security/smclocktheora_2_1075.ogv", | 109 FFMPEG_TEST_CASE(OGV_16, "security/smclocktheora_2_1075.ogv", |
105 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 110 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
106 FFMPEG_TEST_CASE(OGV_17, "security/vorbis.482086.ogv", | 111 FFMPEG_TEST_CASE(OGV_17, "security/vorbis.482086.ogv", |
107 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 112 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
| 113 FFMPEG_TEST_CASE(OGV_18, "security/wav.711.ogv", DECODER_ERROR_NOT_SUPPORTED, |
| 114 DECODER_ERROR_NOT_SUPPORTED); |
108 | 115 |
109 // General WebM test cases. | 116 // General WebM test cases. |
110 FFMPEG_TEST_CASE(WEBM_1, "security/no-bug.webm", PIPELINE_OK, PIPELINE_OK); | 117 FFMPEG_TEST_CASE(WEBM_1, "security/no-bug.webm", PIPELINE_OK, PIPELINE_OK); |
111 FFMPEG_TEST_CASE(WEBM_2, "security/uninitialize.webm", PIPELINE_ERROR_DECODE, | 118 FFMPEG_TEST_CASE(WEBM_2, "security/uninitialize.webm", PIPELINE_ERROR_DECODE, |
112 PIPELINE_ERROR_DECODE); | 119 PIPELINE_ERROR_DECODE); |
113 FFMPEG_TEST_CASE(WEBM_3, "security/out.webm.139771.2965", | 120 FFMPEG_TEST_CASE(WEBM_3, "security/out.webm.139771.2965", |
114 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 121 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
115 FFMPEG_TEST_CASE(WEBM_4, "security/out.webm.68798.1929", | 122 FFMPEG_TEST_CASE(WEBM_4, "security/out.webm.68798.1929", |
116 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | 123 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); |
117 | 124 |
118 // Flaky, maybe larger issues. | 125 // Flaky, maybe larger issues. All eventually fail in the browser. |
119 FFMPEG_TEST_CASE(Cr100464, "security/100464.webm", PIPELINE_OK, | 126 FFMPEG_TEST_CASE(FLAKY_Cr99652, "security/99652.webm", PIPELINE_OK, |
120 PIPELINE_ERROR_DECODE); | 127 PIPELINE_ERROR_DECODE); |
| 128 FFMPEG_TEST_CASE(FLAKY_Cr100464, "security/100464.webm", PIPELINE_OK, |
| 129 PIPELINE_ERROR_DECODE); |
| 130 FFMPEG_TEST_CASE(FLAKY_Cr111342, "security/111342.ogm", PIPELINE_OK, |
| 131 PIPELINE_ERROR_DECODE); |
| 132 FFMPEG_TEST_CASE(FLAKY_OGV_0, "security/big_dims.ogv", PIPELINE_OK, |
| 133 PIPELINE_ERROR_DECODE); |
| 134 FFMPEG_TEST_CASE(FLAKY_OGV_3, "security/smclock_1_0.ogv", PIPELINE_ERROR_DECODE, |
| 135 PIPELINE_ERROR_DECODE); |
| 136 FFMPEG_TEST_CASE(FLAKY_OGV_4, "security/smclock.ogv.1.0.ogv", |
| 137 PIPELINE_OK, PIPELINE_ERROR_DECODE); |
| 138 FFMPEG_TEST_CASE(FLAKY_OGV_6, "security/smclocktheora_1_10000.ogv", |
| 139 PIPELINE_OK, PIPELINE_ERROR_DECODE); |
| 140 FFMPEG_TEST_CASE(FLAKY_OGV_13, "security/smclocktheora_1_790.ogv", |
| 141 PIPELINE_ERROR_DECODE, PIPELINE_ERROR_DECODE); |
121 | 142 |
122 // Current crashers. | 143 // Current crashers. |
123 // FFMPEG_TEST_CASE(Cr111342, "security/111342.ogm", PIPELINE_OK, PIPELINE_OK); | |
124 // FFMPEG_TEST_CASE(OGV_15, "security/smclocktheora_2_10619.ogv", | |
125 // DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED); | |
126 // FFMPEG_TEST_CASE(OGV_18, "security/wav.711.ogv", PIPELINE_OK, PIPELINE_OK); | |
127 // FFMPEG_TEST_CASE(Cr112976, "security/112976.ogg", PIPELINE_OK, PIPELINE_OK); | 144 // FFMPEG_TEST_CASE(Cr112976, "security/112976.ogg", PIPELINE_OK, PIPELINE_OK); |
128 | 145 |
129 // Clock failures. http://crbug.com/113037 | 146 // Clock failures. http://crbug.com/113037 |
130 // FFMPEG_TEST_CASE(MP4_3, "security/clockh264aac_300413969.mp4", PIPELINE_OK, | 147 // FFMPEG_TEST_CASE(MP4_3, "security/clockh264aac_300413969.mp4", PIPELINE_OK, |
131 // PIPELINE_OK); | 148 // PIPELINE_OK); |
132 // FFMPEG_TEST_CASE(WEBM_0, "security/memcpy.webm", PIPELINE_OK, PIPELINE_OK); | 149 // FFMPEG_TEST_CASE(WEBM_0, "security/memcpy.webm", PIPELINE_OK, PIPELINE_OK); |
133 | 150 |
134 TEST_P(FFmpegRegressionTest, BasicPlayback) { | 151 TEST_P(FFmpegRegressionTest, BasicPlayback) { |
135 if (GetParam().init_status == PIPELINE_OK) { | 152 if (GetParam().init_status == PIPELINE_OK) { |
136 ASSERT_TRUE(Start(GetTestDataURL(GetParam().filename), | 153 ASSERT_TRUE(Start(GetTestDataURL(GetParam().filename), |
137 GetParam().init_status)); | 154 GetParam().init_status)); |
138 Play(); | 155 Play(); |
139 ASSERT_EQ(WaitUntilEndedOrError(), GetParam().end_status); | 156 ASSERT_EQ(WaitUntilEndedOrError(), GetParam().end_status); |
140 | 157 |
141 // Check for ended if the pipeline is expected to finish okay. | 158 // Check for ended if the pipeline is expected to finish okay. |
142 if (GetParam().end_status == PIPELINE_OK) | 159 if (GetParam().end_status == PIPELINE_OK) |
143 ASSERT_TRUE(ended_); | 160 ASSERT_TRUE(ended_); |
144 } else { | 161 } else { |
145 ASSERT_FALSE(Start(GetTestDataURL(GetParam().filename), | 162 ASSERT_FALSE(Start(GetTestDataURL(GetParam().filename), |
146 GetParam().init_status)); | 163 GetParam().init_status)); |
147 } | 164 } |
148 } | 165 } |
149 | 166 |
150 } // namespace media | 167 } // namespace media |
OLD | NEW |