#include "components/feature_engagement/internal/feature_config_condition_validator.h"
#include <map>
#include <memory>
#include <string>
#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/feature_engagement/internal/availability_model.h"
#include "components/feature_engagement/internal/event_model.h"
#include "components/feature_engagement/internal/noop_display_lock_controller.h"
#include "components/feature_engagement/internal/proto/feature_event.pb.h"
#include "components/feature_engagement/internal/test/event_util.h"
#include "components/feature_engagement/internal/test/test_time_provider.h"
#include "components/feature_engagement/public/configuration.h"
#include "components/feature_engagement/public/tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace feature_engagement {
namespace {
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
FeatureConfig GetValidFeatureConfig() { … }
FeatureConfig GetAcceptingFeatureConfig() { … }
FeatureConfig GetNonBlockingFeatureConfig() { … }
GroupConfig GetValidGroupConfig() { … }
GroupConfig GetAcceptingGroupConfig() { … }
SessionRateImpact CreateSessionRateImpactTypeExplicit(
std::vector<std::string> affected_features) { … }
class TestConfiguration : public Configuration { … };
class TestEventModel : public EventModel { … };
class TestAvailabilityModel : public AvailabilityModel { … };
class TestDisplayLockController : public DisplayLockController { … };
class FeatureConfigConditionValidatorTest : public ::testing::Test { … };
}
TEST_F(FeatureConfigConditionValidatorTest, ModelNotReadyShouldFail) { … }
TEST_F(FeatureConfigConditionValidatorTest, ConfigInvalidShouldFail) { … }
TEST_F(FeatureConfigConditionValidatorTest, MultipleErrorsShouldBeSet) { … }
TEST_F(FeatureConfigConditionValidatorTest, ReadyModelEmptyConfig) { … }
TEST_F(FeatureConfigConditionValidatorTest, ReadyModelAcceptingConfig) { … }
TEST_F(FeatureConfigConditionValidatorTest, Used) { … }
TEST_F(FeatureConfigConditionValidatorTest, Trigger) { … }
TEST_F(FeatureConfigConditionValidatorTest, SingleOKPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, MultipleOKPreconditions) { … }
TEST_F(FeatureConfigConditionValidatorTest, OneOKThenOneFailingPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, OneFailingThenOneOKPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, TwoFailingPreconditions) { … }
TEST_F(FeatureConfigConditionValidatorTest, PriorityNotification) { … }
TEST_F(FeatureConfigConditionValidatorTest, SessionRate) { … }
TEST_F(FeatureConfigConditionValidatorTest, SessionRateIsZeroAfterReset) { … }
TEST_F(FeatureConfigConditionValidatorTest, SessionRateImpactAffectsNone) { … }
TEST_F(FeatureConfigConditionValidatorTest, SessionRateImpactAffectsExplicit) { … }
TEST_F(FeatureConfigConditionValidatorTest, SessionRateImpactAffectsSelf) { … }
TEST_F(FeatureConfigConditionValidatorTest,
SessionRateImpactAffectsExplicitMultipleFeatures) { … }
TEST_F(FeatureConfigConditionValidatorTest, Availability) { … }
TEST_F(FeatureConfigConditionValidatorTest, SnoozeExpiration) { … }
TEST_F(FeatureConfigConditionValidatorTest, ShouldShowSnooze) { … }
TEST_F(FeatureConfigConditionValidatorTest, SingleEventChangingComparator) { … }
TEST_F(FeatureConfigConditionValidatorTest, SingleEventChangingWindow) { … }
TEST_F(FeatureConfigConditionValidatorTest, CapEarliestAcceptedDayAtEpoch) { … }
TEST_F(FeatureConfigConditionValidatorTest, TestMultipleEvents) { … }
TEST_F(FeatureConfigConditionValidatorTest, TestStaggeredTriggering) { … }
TEST_F(FeatureConfigConditionValidatorTest, TestMultipleEventsWithSameName) { … }
TEST_F(FeatureConfigConditionValidatorTest, DisplayLockedStatus) { … }
TEST_F(FeatureConfigConditionValidatorTest, TestConcurrentPromosBlockingAll) { … }
TEST_F(FeatureConfigConditionValidatorTest, TestConcurrentPromosBlockingNone) { … }
TEST_F(FeatureConfigConditionValidatorTest,
TestConcurrentPromosBlockingExplicitBlocked) { … }
TEST_F(FeatureConfigConditionValidatorTest,
TestConcurrentPromosBlockingExplicitNotBlocked) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupConfigInvalidShouldFail) { … }
TEST_F(FeatureConfigConditionValidatorTest, ReadyModelEmptyGroupConfig) { … }
TEST_F(FeatureConfigConditionValidatorTest, ReadyModelAcceptingGroupConfig) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupTrigger) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupSingleOKPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupMultipleOKPreconditions) { … }
TEST_F(FeatureConfigConditionValidatorTest,
GroupOneOKThenOneFailingPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, MultipleGroupOKPreconditions) { … }
TEST_F(FeatureConfigConditionValidatorTest,
MultipleGroupOneOKThenOneFailingPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest,
MultipleGroupOneFailingThenOneOKPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, FeatureAndGroupOKPreconditions) { … }
TEST_F(FeatureConfigConditionValidatorTest,
FeatureOKThenGroupFailingPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest,
FeatureFailingThenGroupOKPrecondition) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupSessionRate) { … }
TEST_F(FeatureConfigConditionValidatorTest, GroupSessionRateIsZeroAfterReset) { … }
TEST_F(FeatureConfigConditionValidatorTest,
GroupAndFeatureSessionRateGroupLower) { … }
TEST_F(FeatureConfigConditionValidatorTest,
GroupAndFeatureSessionRateGroupHigher) { … }
TEST_F(FeatureConfigConditionValidatorTest, TwoGroupsSessionRate) { … }
}