chromium/media/filters/audio_timestamp_validator_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/filters/audio_timestamp_validator.h"

#include <tuple>

#include "base/time/time.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_util.h"
#include "media/base/mock_media_log.h"
#include "media/base/test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"

HasSubstr;

namespace media {

// Constants to specify the type of audio data used.
static const AudioCodec kCodec =;
static const SampleFormat kSampleFormat =;
static const base::TimeDelta kSeekPreroll;
static const int kSamplesPerSecond =;
static const base::TimeDelta kBufferDuration =;
static const ChannelLayout kChannelLayout =;
static const int kChannelCount =;
static const int kChannels =;
static const int kFramesPerBuffer =;

// Params are:
// 1. Output delay: number of encoded buffers before first decoded output
// 2. Codec delay: number of frames of codec delay in decoder config
// 3. Front discard: front discard for the first buffer
ValidatorTestParams;

class AudioTimestampValidatorTest
    : public testing::Test,
      public ::testing::WithParamInterface<ValidatorTestParams> {};

TEST_P(AudioTimestampValidatorTest, WarnForEraticTimes) {}

TEST_P(AudioTimestampValidatorTest, NoWarningForValidTimes) {}

TEST_P(AudioTimestampValidatorTest, SingleWarnForSingleLargeGap) {}

TEST_P(AudioTimestampValidatorTest, RepeatedWarnForSlowAccumulatingDrift) {}

// Test with cartesian product of various output delay, codec delay, and front
// discard values. These simulate configurations for different containers/codecs
// which present different challenges when building timestamp expectations.
INSTANTIATE_TEST_SUITE_P();

}  // namespace media