15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Regression tests for FFmpeg.  Security test files can be found in the
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// internal media test data directory:
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    svn://svn.chromium.org/chrome-internal/trunk/data/media/security/
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Simply add the custom_dep below to your gclient and sync:
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    "src/media/test/data/security":
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//        "svn://chrome-svn/chrome-internal/trunk/data/media/security"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Many of the files here do not cause issues outside of tooling, so you'll need
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to run this test under ASAN, TSAN, and Valgrind to ensure that all issues are
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// caught.
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Test cases labeled FLAKY may not always pass, but they should never crash or
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// cause any kind of warnings or errors under tooling.
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Frame hashes must be generated with --video-threads=1 for correctness.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Known issues:
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    Cr47325 will generate an UninitValue error under Valgrind inside of the
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    MD5 hashing code.  The error occurs due to some problematic error
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    resilence code for H264 inside of FFmpeg.  See http://crbug.com/119020
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    Some OGG files leak ~30 bytes of memory, upstream tracking bug:
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//    https://ffmpeg.org/trac/ffmpeg/ticket/1244
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)//    Some OGG files leak hundreds of kilobytes of memory, upstream bug:
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)//    https://ffmpeg.org/trac/ffmpeg/ticket/1931
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "media/filters/pipeline_integration_test_base.h"
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/bind.h"
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "media/base/test_data_util.h"
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace media {
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct RegressionTestData {
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  RegressionTestData(const char* filename, PipelineStatus init_status,
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     PipelineStatus end_status, const char* video_md5,
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     const char* audio_md5)
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      : video_md5(video_md5),
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        audio_md5(audio_md5),
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        filename(filename),
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        init_status(init_status),
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        end_status(end_status) {
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  const char* video_md5;
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  const char* audio_md5;
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  const char* filename;
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  PipelineStatus init_status;
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  PipelineStatus end_status;
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Used for tests which just need to run without crashing or tooling errors, but
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// which may have undefined behavior for hashing, etc.
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct FlakyRegressionTestData {
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  FlakyRegressionTestData(const char* filename)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      : filename(filename) {
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  const char* filename;
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FFmpegRegressionTest
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    : public testing::TestWithParam<RegressionTestData>,
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      public PipelineIntegrationTestBase {
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FlakyFFmpegRegressionTest
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    : public testing::TestWithParam<FlakyRegressionTestData>,
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      public PipelineIntegrationTestBase {
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define FFMPEG_TEST_CASE(name, fn, init_status, end_status, video_md5, \
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                         audio_md5) \
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    INSTANTIATE_TEST_CASE_P(name, FFmpegRegressionTest, \
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            testing::Values(RegressionTestData(fn, \
845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                               init_status, \
855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                               end_status, \
865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                               video_md5, \
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                                               audio_md5)));
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
8990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#define FLAKY_FFMPEG_TEST_CASE(name, fn) \
9090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    INSTANTIATE_TEST_CASE_P(FLAKY_##name, FlakyFFmpegRegressionTest, \
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            testing::Values(FlakyRegressionTestData(fn)));
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Test cases from issues.
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr47325, "security/47325.mp4", PIPELINE_OK, PIPELINE_OK,
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 "2a7a938c6b5979621cec998f02d9bbb6",
9690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "3.61,1.64,-3.24,0.12,1.50,-0.86,");
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr47761, "content/crbug47761.ogg", PIPELINE_OK, PIPELINE_OK,
9890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash,
9990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "8.89,8.55,8.88,8.01,8.23,7.69,");
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr50045, "content/crbug50045.mp4", PIPELINE_OK, PIPELINE_OK,
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 "c345e9ef9ebfc6bfbcbe3f0ddc3125ba",
10290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "2.72,-6.27,-6.11,-3.17,-5.58,1.26,");
10390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FFMPEG_TEST_CASE(Cr62127, "content/crbug62127.webm", PIPELINE_OK,
10490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, "a064b2776fc5aef3e9cba47967a75db9",
10590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullAudioHash);
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr93620, "security/93620.ogg", PIPELINE_OK, PIPELINE_OK,
10790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash,
10890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-10.55,-10.10,-10.42,-10.35,-10.29,-10.72,");
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr100492, "security/100492.webm", DECODER_ERROR_NOT_SUPPORTED,
11090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr100543, "security/100543.webm", PIPELINE_OK, PIPELINE_OK,
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 "c16691cc9178db3adbf7e562cadcd6e6",
11390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "1211.73,304.89,1311.54,371.34,1283.06,299.63,");
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr101458, "security/101458.webm", DECODER_ERROR_NOT_SUPPORTED,
11590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr108416, "security/108416.webm", PIPELINE_OK, PIPELINE_OK,
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 "5cb3a934795cd552753dec7687928291",
11890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-17.87,-37.20,-23.33,45.57,8.13,-9.92,");
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr110849, "security/110849.mkv",
1202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN,
12190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
12290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr112384, "security/112384.webm",
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_PARSE, DEMUXER_ERROR_COULD_NOT_PARSE,
12590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr117912, "security/117912.webm", DEMUXER_ERROR_COULD_NOT_OPEN,
12790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, kNullVideoHash, kNullAudioHash);
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr123481, "security/123481.ogv", PIPELINE_OK,
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 PIPELINE_OK, "e6dd853fcbd746c8bb2ab2b8fc376fc7",
13090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "1.28,-0.32,-0.81,0.08,1.66,0.89,");
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr132779, "security/132779.webm",
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_PARSE, DEMUXER_ERROR_COULD_NOT_PARSE,
13390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr140165, "security/140165.ogg", PIPELINE_ERROR_DECODE,
13590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_ERROR_DECODE, kNullVideoHash, kNullAudioHash);
1362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)FFMPEG_TEST_CASE(Cr140647, "security/140647.ogv", DEMUXER_ERROR_COULD_NOT_OPEN,
13790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, kNullVideoHash, kNullAudioHash);
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr142738, "content/crbug142738.ogg", PIPELINE_OK, PIPELINE_OK,
13990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash,
14090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-1.22,0.45,1.79,1.80,-0.30,-1.21,");
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(Cr152691, "security/152691.mp3", PIPELINE_ERROR_DECODE,
14290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_ERROR_DECODE, kNullVideoHash, kNullAudioHash);
14390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FFMPEG_TEST_CASE(Cr161639, "security/161639.m4a", PIPELINE_ERROR_DECODE,
14490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_ERROR_DECODE, kNullVideoHash, kNullAudioHash);
1452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)FFMPEG_TEST_CASE(Cr222754, "security/222754.mp4", PIPELINE_ERROR_DECODE,
14690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_ERROR_DECODE, kNullVideoHash, kNullAudioHash);
14790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FFMPEG_TEST_CASE(Cr234630a, "security/234630a.mov", PIPELINE_OK,
14890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
14990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-15.52,-18.90,-15.33,-16.68,-14.41,-15.89,");
15090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FFMPEG_TEST_CASE(Cr234630b, "security/234630b.mov", PIPELINE_ERROR_DECODE,
15190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_ERROR_DECODE, kNullVideoHash, kNullAudioHash);
15290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FFMPEG_TEST_CASE(Cr242786, "security/242786.webm", PIPELINE_OK,
15390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
15490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-1.72,-0.83,0.84,1.70,1.23,-0.53,");
1553551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Test for out-of-bounds access with slightly corrupt file (detection logic
1563551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// thinks it's a MONO file, but actually contains STEREO audio).
1573551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)FFMPEG_TEST_CASE(Cr275590, "security/275590.m4a",
1583551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DEMUXER_ERROR_COULD_NOT_OPEN,
1593551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// General MP4 test cases.
1622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)FFMPEG_TEST_CASE(MP4_0, "security/aac.10419.mp4", DEMUXER_ERROR_COULD_NOT_OPEN,
16390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, kNullVideoHash, kNullAudioHash);
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_1, "security/clockh264aac_200021889.mp4",
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
16690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_2, "security/clockh264aac_200701257.mp4", PIPELINE_OK,
16890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash, kNullAudioHash);
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_5, "security/clockh264aac_3022500.mp4",
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
17190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
17290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_6, "security/clockh264aac_344289.mp4", PIPELINE_OK,
17490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash, kNullAudioHash);
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_7, "security/clockh264mp3_187697.mp4",
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
17890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_8, "security/h264.705767.mp4",
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_PARSE, DEMUXER_ERROR_COULD_NOT_PARSE,
18190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_9, "security/smclockmp4aac_1_0.mp4",
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
18490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(MP4_16, "security/looping2.mov",
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
18790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// General OGV test cases.
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_1, "security/out.163.ogv", DECODER_ERROR_NOT_SUPPORTED,
19190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_2, "security/out.391.ogv", DECODER_ERROR_NOT_SUPPORTED,
19390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_5, "security/smclocktheora_1_0.ogv",
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
19690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_7, "security/smclocktheora_1_102.ogv",
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
19990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_8, "security/smclocktheora_1_104.ogv",
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
20290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_9, "security/smclocktheora_1_110.ogv",
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
20590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_10, "security/smclocktheora_1_179.ogv",
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
20890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_11, "security/smclocktheora_1_20.ogv",
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
21190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_12, "security/smclocktheora_1_723.ogv",
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
21490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_14, "security/smclocktheora_2_10405.ogv",
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
21790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_15, "security/smclocktheora_2_10619.ogv",
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
22090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_16, "security/smclocktheora_2_1075.ogv",
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
22390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_18, "security/wav.711.ogv", DECODER_ERROR_NOT_SUPPORTED,
22590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_19, "security/null1.ogv", DECODER_ERROR_NOT_SUPPORTED,
22790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_20, "security/null2.ogv", DECODER_ERROR_NOT_SUPPORTED,
22990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_21, "security/assert1.ogv", DECODER_ERROR_NOT_SUPPORTED,
23190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(OGV_22, "security/assert2.ogv", DECODER_ERROR_NOT_SUPPORTED,
23390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, kNullVideoHash, kNullAudioHash);
2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// General WebM test cases.
2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(WEBM_1, "security/no-bug.webm", PIPELINE_OK, PIPELINE_OK,
23790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "39e92700cbb77478fd63f49db855e7e5", kNullAudioHash);
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(WEBM_3, "security/out.webm.139771.2965",
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
24090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(WEBM_4, "security/out.webm.68798.1929",
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DECODER_ERROR_NOT_SUPPORTED, DECODER_ERROR_NOT_SUPPORTED,
24390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(WEBM_5, "content/frame_size_change.webm", PIPELINE_OK,
24590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, "d8fcf2896b7400a2261bac9e9ea930f8",
24690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullAudioHash);
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Audio Functional Tests
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_0, "content/gaming/a_220_00.mp3", PIPELINE_OK,
25090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
25190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "0.36,1.25,2.98,4.29,4.19,2.76,");
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_1, "content/gaming/a_220_00_v2.ogg", PIPELINE_OK,
25390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
25490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "2.17,3.31,5.15,6.33,5.97,4.35,");
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_2, "content/gaming/ai_laser1.ogg", PIPELINE_OK,
25690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
25790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "7.70,10.81,13.19,10.07,7.39,7.56,");
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_3, "content/gaming/ai_laser2.ogg", PIPELINE_OK,
25990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
26090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "5.99,8.04,9.71,8.69,7.81,7.52,");
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_4, "content/gaming/ai_laser3.ogg", PIPELINE_OK,
26290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
26390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-0.32,1.44,3.75,5.88,6.32,3.22,");
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_5, "content/gaming/ai_laser4.ogg", PIPELINE_OK,
26590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
26690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "4.75,4.16,2.21,3.01,5.51,6.11,");
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_6, "content/gaming/ai_laser5.ogg", PIPELINE_OK,
26890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
26990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "6.04,7.46,8.78,7.32,4.16,3.97,");
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_7, "content/gaming/footstep1.ogg", PIPELINE_OK,
27190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
27290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-0.50,0.29,2.35,4.79,5.14,2.24,");
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_8, "content/gaming/footstep3.ogg", PIPELINE_OK,
27490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
27590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-2.87,-3.05,-4.10,-3.20,-2.20,-2.20,");
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_9, "content/gaming/footstep4.ogg", PIPELINE_OK,
27790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
27890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "10.35,10.74,11.60,12.83,12.69,10.67,");
2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_10, "content/gaming/laser1.ogg", PIPELINE_OK,
28090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
28190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-9.48,-12.94,-1.75,7.66,5.61,-0.58,");
2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_11, "content/gaming/laser2.ogg", PIPELINE_OK,
28390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
28490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-7.53,-6.28,3.37,0.73,-5.83,-4.70,");
2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_12, "content/gaming/laser3.ogg", PIPELINE_OK,
28690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
28790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-13.62,-6.55,2.52,-10.10,-10.68,-5.43,");
2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_13, "content/gaming/leg1.ogg", PIPELINE_OK,
28990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
29090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "5.62,5.79,5.81,5.60,6.18,6.15,");
2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_14, "content/gaming/leg2.ogg", PIPELINE_OK,
29290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
29390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-0.88,1.32,2.74,3.07,0.88,-0.03,");
2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_15, "content/gaming/leg3.ogg", PIPELINE_OK,
29590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
29690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "17.77,18.59,19.57,18.84,17.62,17.22,");
2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_16, "content/gaming/lock_on.ogg", PIPELINE_OK,
29890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, kNullVideoHash,
29990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "3.08,-4.33,-5.04,-0.24,1.83,5.16,");
3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_17, "content/gaming/enemy_lock_on.ogg",
30190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, PIPELINE_OK, kNullVideoHash,
30290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-2.24,-1.00,-2.75,-0.87,1.11,-0.58,");
3035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(AUDIO_GAMING_18, "content/gaming/rocket_launcher.mp3",
30490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 PIPELINE_OK, PIPELINE_OK, kNullVideoHash,
30590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 "-3.08,0.18,2.49,1.98,-2.20,-4.74,");
3065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Allocate gigabytes of memory, likely can't be run on 32bit machines.
3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(BIG_MEM_1, "security/bigmem1.mov",
3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
31090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(BIG_MEM_2, "security/looping1.mov",
3122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
31390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
3145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)FFMPEG_TEST_CASE(BIG_MEM_5, "security/looping5.mov",
3152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                 DEMUXER_ERROR_COULD_NOT_OPEN, DEMUXER_ERROR_COULD_NOT_OPEN,
31690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                 kNullVideoHash, kNullAudioHash);
31790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(BIG_MEM_3, "security/looping3.mov");
31890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(BIG_MEM_4, "security/looping4.mov");
3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Flaky under threading or for other reasons.  Per rbultje, most of these will
3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// never be reliable since FFmpeg does not guarantee consistency in error cases.
3225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// We only really care that these don't cause crashes or errors under tooling.
32390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr99652, "security/99652.webm");
32490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr100464, "security/100464.webm");
32590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr111342, "security/111342.ogm");
32690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_0, "security/big_dims.ogv");
32790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_3, "security/smclock_1_0.ogv");
32890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_4, "security/smclock.ogv.1.0.ogv");
32990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_6, "security/smclocktheora_1_10000.ogv");
33090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_13, "security/smclocktheora_1_790.ogv");
33190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MP4_3, "security/clockh264aac_300413969.mp4");
33290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MP4_4, "security/clockh264aac_301350139.mp4");
33390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MP4_12, "security/assert1.mov");
3345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Not really flaky, but can't pass the seek test.
33590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MP4_10, "security/null1.m4a");
33690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
33790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// TODO(wolenetz/dalecurtis): The following have flaky audio hash result.
33890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// See http://crbug.com/237371
33990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr112976, "security/112976.ogg");
34090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MKV_0, "security/nested_tags_lang.mka.627.628");
34190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MKV_1, "security/nested_tags_lang.mka.667.628");
34290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(MP4_11, "security/null1.mp4");
34390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
34490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// TODO(wolenetz/dalecurtis): The following have flaky init status: on mac
34590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// ia32 Chrome, observed PIPELINE_OK instead of DECODER_ERROR_NOT_SUPPORTED.
34690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr112670, "security/112670.mp4");
34790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(OGV_17, "security/vorbis.482086.ogv");
34890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
34990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// TODO(wolenetz/dalecurtis): The following have flaky init status: on mac
35090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// ia32 Chrome, observed DUMUXER_ERROR_NO_SUPPORTED_STREAMS instead of
35190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// DECODER_ERROR_NOT_SUPPORTED.
35290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(Cr116927, "security/116927.ogv");
35390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)FLAKY_FFMPEG_TEST_CASE(WEBM_2, "security/uninitialize.webm");
3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Videos with massive gaps between frame timestamps that result in long hangs
3565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// with our pipeline.  Should be uncommented when we support clockless playback.
3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// FFMPEG_TEST_CASE(WEBM_0, "security/memcpy.webm", PIPELINE_OK, PIPELINE_OK,
35890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)//                  kNullVideoHash, kNullAudioHash);
3595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// FFMPEG_TEST_CASE(MP4_17, "security/assert2.mov", PIPELINE_OK, PIPELINE_OK,
36090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)//                  kNullVideoHash, kNullAudioHash);
3615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// FFMPEG_TEST_CASE(OGV_23, "security/assert2.ogv", PIPELINE_OK, PIPELINE_OK,
36290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)//                  kNullVideoHash, kNullAudioHash);
3635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)TEST_P(FFmpegRegressionTest, BasicPlayback) {
3655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  if (GetParam().init_status == PIPELINE_OK) {
3662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    ASSERT_TRUE(Start(GetTestDataFilePath(GetParam().filename),
3673551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                      GetParam().init_status, kHashed));
3685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    Play();
3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ASSERT_EQ(WaitUntilEndedOrError(), GetParam().end_status);
3702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    EXPECT_EQ(GetParam().video_md5, GetVideoHash());
3712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    EXPECT_EQ(GetParam().audio_md5, GetAudioHash());
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Check for ended if the pipeline is expected to finish okay.
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    if (GetParam().end_status == PIPELINE_OK) {
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      ASSERT_TRUE(ended_);
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      // Tack a seek on the end to catch any seeking issues.
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)      Seek(base::TimeDelta::FromMilliseconds(0));
3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    }
3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  } else {
3812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    ASSERT_FALSE(Start(GetTestDataFilePath(GetParam().filename),
3823551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)                       GetParam().init_status, kHashed));
3832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    EXPECT_EQ(GetParam().video_md5, GetVideoHash());
3842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    EXPECT_EQ(GetParam().audio_md5, GetAudioHash());
3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)TEST_P(FlakyFFmpegRegressionTest, BasicPlayback) {
3892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  if (Start(GetTestDataFilePath(GetParam().filename))) {
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    Play();
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    WaitUntilEndedOrError();
3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  }
3935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
3945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace media
396