chromium/chrome/browser/user_education/user_education_configuration_provider_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 "chrome/browser/user_education/user_education_configuration_provider.h"

#include <initializer_list>
#include <memory>
#include <vector>

#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "components/feature_engagement/public/configuration.h"
#include "components/feature_engagement/public/feature_list.h"
#include "components/feature_engagement/public/group_list.h"
#include "components/feature_engagement/public/tracker.h"
#include "components/strings/grit/components_strings.h"
#include "components/user_education/common/feature_promo_handle.h"
#include "components/user_education/common/feature_promo_registry.h"
#include "components/user_education/common/feature_promo_specification.h"
#include "components/user_education/common/user_education_features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/interaction/element_identifier.h"

namespace {

constexpr char kToastTrigger[] =;
constexpr char kToastUsed[] =;
constexpr char kSnoozeTrigger[] =;
constexpr char kSnoozeUsed[] =;
constexpr uint32_t kAdditionalConditionDelayDays =;
constexpr uint32_t kAdditionalConditionUsedLimit =;
constexpr char kAdditionalConditionName[] =;
constexpr char kAdditionalCondition2Name[] =;
constexpr uint32_t kAdditionalConditionCount =;
constexpr uint32_t kAdditionalConditionDays =;
constexpr char kKeyedNoticeTrigger[] =;
constexpr char kKeyedNoticeUsed[] =;
constexpr char kLegalNoticeTrigger[] =;
constexpr char kLegalNoticeUsed[] =;
constexpr char kActionableAlertTrigger[] =;
constexpr char kActionableAlertUsed[] =;
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
BASE_FEATURE();
const std::initializer_list<const base::Feature*> kKnownFeatures{};
const std::initializer_list<const base::Feature*> kKnownGroups{};

DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();

// Provider must be created after possibly setting v2 feature flag.
//
// Call this only when the provider is actually needed for the test, and after
// SetEnableV2 (if necessary).
template <typename... Args>
std::unique_ptr<UserEducationConfigurationProvider> CreateProvider(
    Args... additional_specifications) {}

}  // namespace

AdditionalConditions;

class UserEducationConfigurationProviderTest : public testing::Test {};

TEST_F(UserEducationConfigurationProviderTest, ProvidesToastConfiguration) {}

TEST_F(UserEducationConfigurationProviderTest, ProvidesSnoozeConfiguration) {}

TEST_F(UserEducationConfigurationProviderTest,
       ProvidesKeyedNoticeConfiguration) {}

TEST_F(UserEducationConfigurationProviderTest,
       ProvidesLegalNoticeConfiguration) {}

TEST_F(UserEducationConfigurationProviderTest,
       ProvidesActionableAlertConfiguration) {}

TEST_F(UserEducationConfigurationProviderTest, HandlesEventConfigs) {}

TEST_F(UserEducationConfigurationProviderTest, DoesntOverwriteNames) {}

TEST_F(UserEducationConfigurationProviderTest, v1_DoesntOverwriteValid) {}

TEST_F(UserEducationConfigurationProviderTest,
       v2_DoesOverwriteValid_SpecifiesUsed) {}

TEST_F(UserEducationConfigurationProviderTest,
       v2_DoesOverwriteValid_NoUsedEvent) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_OriginalAvailabilityPreserved) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_DefaultAvailability) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_AvailabilityFromSpec) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_UsedLimitDefaultAvailability) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_UsedLimitCustomAvailability) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_AddedConditionDefaultAvailability) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_AddedConditionCustomAvailability) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_AddedConditionInAddition) {}

TEST_F(UserEducationConfigurationProviderTest,
       AdditionalConditions_AddedConditionNotOverridden) {}

TEST_F(UserEducationConfigurationProviderTest, v1_SessionRate) {}

TEST_F(UserEducationConfigurationProviderTest, v2_SessionRate) {}

TEST_F(UserEducationConfigurationProviderTest, V1AllowsDuplicateTrigger) {}

TEST_F(UserEducationConfigurationProviderTest, V2RemovesDuplicateTrigger) {}