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