chromium/media/formats/hls/tags_unittest.cc

// Copyright 2022 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/formats/hls/tags.h"

#include <array>
#include <optional>
#include <string_view>
#include <utility>

#include "base/location.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "media/base/media_serializers.h"
#include "media/formats/hls/items.h"
#include "media/formats/hls/parse_status.h"
#include "media/formats/hls/source_string.h"
#include "media/formats/hls/test_util.h"
#include "media/formats/hls/variable_dictionary.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace media::hls {

namespace {

// Returns the maximum whole quantity of seconds that can be represented by this
// implementation.
types::DecimalInteger MaxSeconds() {}

template <typename T>
void ErrorTest(std::optional<std::string_view> content,
               ParseStatusCode expected_status,
               const base::Location& from = base::Location::Current()) {}

template <typename T>
void ErrorTest(std::optional<std::string_view> content,
               const VariableDictionary& variable_dict,
               VariableDictionary::SubstitutionBuffer& sub_buffer,
               ParseStatusCode expected_status,
               const base::Location& from = base::Location::Current()) {}

template <typename T>
struct OkTestResult {};

template <typename T>
OkTestResult<T> OkTest(std::optional<std::string> content,
                       const base::Location& from = base::Location::Current()) {}

template <typename T>
OkTestResult<T> OkTest(std::optional<std::string> content,
                       const VariableDictionary& variable_dict,
                       VariableDictionary::SubstitutionBuffer& sub_buffer,
                       const base::Location& from = base::Location::Current()) {}

// Helper to test identification of this tag in a manifest.
// `line` must be a sample line containing this tag, and must end with a
// newline. This DOES NOT parse the item content (only that the item content
// matches what was expected), use `OkTest` and `ErrorTest` for that.
void RunTagIdenficationTest(
    TagName name,
    std::string_view line,
    std::optional<std::string_view> expected_content,
    const base::Location& from = base::Location::Current()) {}

template <typename T>
void RunTagIdenficationTest(
    std::string_view line,
    std::optional<std::string_view> expected_content,
    const base::Location& from = base::Location::Current()) {}

// Test helper for tags which are expected to have no content
template <typename T>
void RunEmptyTagTest() {}

// There are a couple of tags that are defined simply as `#EXT-X-TAG:n` where
// `n` must be a valid DecimalInteger. This helper provides coverage for those
// tags.
template <typename T>
void RunDecimalIntegerTagTest(types::DecimalInteger T::*field) {}

VariableDictionary CreateBasicDictionary(
    const base::Location& from = base::Location::Current()) {}

}  // namespace

TEST(HlsTagsTest, TagNameIdentity) {}

TEST(HlsTagsTest, ParseM3uTag) {}

TEST(HlsTagsTest, ParseXDefineTag) {}

TEST(HlsTagsTest, ParseXIndependentSegmentsTag) {}

TEST(HlsTagsTest, ParseXStartTag) {}

TEST(HlsTagsTest, ParseXVersionTag) {}

TEST(HlsTagsTest, ParseXContentSteeringTag) {}

TEST(HlsTagsTest, ParseXIFrameStreamInfTag) {}

TEST(HlsTagsTest, ParseXMediaTag) {}

TEST(HlsTagsTest, ParseXSessionDataTag) {}

TEST(HlsTagsTest, ParseXSessionKeyTag) {}

TEST(HlsTagsTest, ParseXStreamInfTag) {}

TEST(HlsTagsTest, ParseInfTag) {}

TEST(HlsTagsTest, ParseXBitrateTag) {}

TEST(HlsTagsTest, ParseXByteRangeTag) {}

TEST(HlsTagsTest, ParseXDateRangeTag) {}

TEST(HlsTagsTest, ParseXDiscontinuityTag) {}

TEST(HlsTagsTest, ParseXDiscontinuitySequenceTag) {}

TEST(HlsTagsTest, ParseXEndListTag) {}

TEST(HlsTagsTest, ParseXGapTag) {}

TEST(HlsTagsTest, ParseXIFramesOnlyTag) {}

TEST(HlsTagsTest, ParseXKeyTag) {}

TEST(HlsTagsTest, ParseXMapTag) {}

TEST(HlsTagsTest, ParseXMediaSequenceTag) {}

TEST(HlsTagsTest, ParseXPartTag) {}

TEST(HlsTagsTest, ParseXPartInfTag) {}

TEST(HlsTagsTest, ParseXPlaylistTypeTag) {}

TEST(HlsTagsTest, ParseXPreloadHintTag) {}

TEST(HlsTagsTest, ParseXProgramDateTimeTag) {}

TEST(HlsTagsTest, ParseXRenditionReportTag) {}

TEST(HlsTagsTest, ParseXServerControlTag) {}

TEST(HlsTagsTest, ParseXSkipTag) {}

TEST(HlsTagsTest, ParseXTargetDurationTag) {}

}  // namespace media::hls