chromium/components/tpcd/metadata/browser/parser_unittest.cc

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

#include "components/tpcd/metadata/browser/parser.h"

#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/content_settings/core/common/features.h"
#include "components/tpcd/metadata/common/proto/metadata.pb.h"
#include "components/tpcd/metadata/browser/test_support.h"
#include "net/base/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/google/compression_utils.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif

namespace tpcd::metadata {
namespace {
IsEmpty;

const base::FilePath::CharType kComponentFileName[] =);
}  // namespace

class ParserTest : public ::testing::Test {};

ParserDeathTest;

TEST_F(ParserDeathTest, ParseMetadata_NonSerializedProto) {}

TEST_F(ParserDeathTest, ParseMetadata_InvalidComponent) {}

TEST_F(ParserDeathTest, ParseMetadataFromFeatureParam_FailedToDecode) {}

TEST_F(ParserDeathTest, ParseMetadataFromFeatureParam_FailedToUnzip) {}

TEST_F(ParserDeathTest, ParseMetadataFromFeatureParam_InvalidProto) {}

// Should be empty when neither Component Updater nor Feature provide metadata.
TEST_F(ParserTest, GetMetadata_MissingMetadata) {}

TEST_F(ParserTest, ParseMetadata_EmptyList) {}

TEST_F(ParserTest, ParseMetadata_NonEmptyList) {}

TEST_F(ParserTest, GetMetadata_ComponentUpdaterOnly) {}

TEST_F(ParserTest, GetMetadata_FeatureParamsOnly) {}

TEST_F(ParserTest, GetMetadata_ComponentUpdaterThenFeatureParams) {}

TEST_F(ParserTest, GetMetadata_FeatureParamsThenComponentUpdater_1) {}

TEST_F(ParserTest, GetMetadata_FeatureParamsThenComponentUpdater_2) {}

}  // namespace tpcd::metadata