chromium/media/filters/audio_file_reader_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/filters/audio_file_reader.h"

#include <memory>
#include <string_view>

#include "base/hash/md5.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_hash.h"
#include "media/base/decoder_buffer.h"
#include "media/base/test_data_util.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/ffmpeg/scoped_av_packet.h"
#include "media/filters/in_memory_url_protocol.h"
#include "media/media_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media {

class AudioFileReaderTest : public testing::Test {};

TEST_F(AudioFileReaderTest, WithoutOpen) {}

TEST_F(AudioFileReaderTest, InvalidFile) {}

TEST_F(AudioFileReaderTest, UnknownDuration) {}

TEST_F(AudioFileReaderTest, WithVideo) {}

TEST_F(AudioFileReaderTest, Vorbis) {}

TEST_F(AudioFileReaderTest, WaveU8) {}

TEST_F(AudioFileReaderTest, WaveS16LE) {}

TEST_F(AudioFileReaderTest, WaveS24LE) {}

TEST_F(AudioFileReaderTest, WaveF32LE) {}

TEST_F(AudioFileReaderTest, MP3) {}

TEST_F(AudioFileReaderTest, CorruptMP3) {}

#if BUILDFLAG(USE_PROPRIETARY_CODECS)
TEST_F(AudioFileReaderTest, AAC) {
  RunTest("sfx.m4a", "0.79,2.31,4.15,4.92,4.04,1.44,", 1, 44100,
          base::Microseconds(347665), 15333, 12701);
}

TEST_F(AudioFileReaderTest, AAC_SinglePacket) {
  RunTest("440hz-10ms.m4a", "3.77,4.53,4.75,3.48,3.67,3.76,", 1, 44100,
          base::Microseconds(69660), 3073, 441);
}

TEST_F(AudioFileReaderTest, AAC_ADTS) {
  RunTest("sfx.adts", "1.80,1.66,2.31,3.26,4.46,3.36,", 1, 44100,
          base::Microseconds(384733), 16967, 13312);
}

TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) {
  RunTestFailingDecode("midstream_config_change.mp3", 0);
}
#endif

TEST_F(AudioFileReaderTest, VorbisInvalidChannelLayout) {}

TEST_F(AudioFileReaderTest, WaveValidFourChannelLayout) {}

TEST_F(AudioFileReaderTest, ReadPartialMP3) {}

}  // namespace media