#include "components/optimization_guide/core/model_execution/model_execution_features_controller.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/component_updater/pref_names.h"
#include "components/optimization_guide/core/feature_registry/feature_registration.h"
#include "components/optimization_guide/core/feature_registry/mqls_feature_registry.h"
#include "components/optimization_guide/core/feature_registry/settings_ui_registry.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/model_execution/model_execution_features.h"
#include "components/optimization_guide/core/model_execution/model_execution_prefs.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/optimization_guide/proto/model_quality_service.pb.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/account_capabilities_test_mutator.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "components/signin/public/identity_manager/test_identity_manager_observer.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/tflite/buildflags.h"
namespace optimization_guide {
ModelExecutionEnterprisePolicyValue;
class ModelExecutionFeaturesControllerTest : public testing::Test { … };
TEST_F(ModelExecutionFeaturesControllerTest, OneFeatureSettingVisible) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
DefaultFeatureSettingForUnsignedUser) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
FeatureSettingChangedForUnsignedUser) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
FeatureAllowedForSignedUserWithoutCapabilityWhenUnsignedUserAllowed) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
FeatureSettingDisabledWhenCapabilityDisabled) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
FeatureSettingAllowedWhenCapabilityCheckDisabled) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
MainToggleEnablesAllVisibleFeatures) { … }
TEST_F(ModelExecutionFeaturesControllerTest, GraduatedFeatureIsNotVisible) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
Logging_DisabledByEnterprisePolicy) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
Logging_DisabledByEnterprisePolicy_NotOverriddenByDogfoodStatusAlone) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
Logging_DisabledByEnterprisePolicy_NotOverriddenBySwitchAlone) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
Logging_DisabledByEnterprisePolicy_OverriddenBySwitchWhenDogfood) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
HistorySearchVisibilityWithXNNPACK) { … }
#if BUILDFLAG(BUILD_TFLITE_WITH_XNNPACK)
TEST_F(ModelExecutionFeaturesControllerTest,
HistorySearchVisibilityWithPerformanceClass) { … }
TEST_F(ModelExecutionFeaturesControllerTest,
HistorySearchSettingsIsHiddenWithComponentUpdatesDisabled) { … }
#endif
}