#include "components/variations/field_trial_internals_utils.h"
#include <string_view>
#include "base/metrics/field_trial.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
#include "components/variations/hashing.h"
#include "components/variations/pref_names.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace variations {
namespace {
ElementsAre;
Pair;
HashNameAsHexString;
kVariationsForcedFieldTrials;
kVariationsForcedTrialExpiration;
kVariationsForcedTrialStarts;
variations::StudyGroupNames MakeStudy(std::string_view name) { … }
class FieldTrialInternalsUtilsTest : public testing::Test { … };
TEST_F(FieldTrialInternalsUtilsTest, ForceTrialsAtStartupHasTrialOverride) { … }
TEST_F(FieldTrialInternalsUtilsTest, ForceTrialsAtStartupExpiredByTime) { … }
TEST_F(FieldTrialInternalsUtilsTest,
ForceTrialsAtStartupExpiredByInvalidExpiryTime) { … }
TEST_F(FieldTrialInternalsUtilsTest,
ForceTrialsAtStartupExpiredByRestartCount) { … }
TEST_F(FieldTrialInternalsUtilsTest, ForceTrialsAtStartupNoPrefsStored) { … }
TEST_F(FieldTrialInternalsUtilsTest, SetTemporaryTrialOverridesOneGroup) { … }
TEST_F(FieldTrialInternalsUtilsTest, SetTemporaryTrialOverridesTwoGroups) { … }
TEST_F(FieldTrialInternalsUtilsTest,
SetTemporaryTrialOverridesThenForceTrialsAtStartup) { … }
TEST_F(FieldTrialInternalsUtilsTest, EmulateMultipleStarts) { … }
TEST_F(FieldTrialInternalsUtilsTest,
RefreshAndGetFieldTrialOverridesWithEmptyState) { … }
TEST_F(FieldTrialInternalsUtilsTest,
RefreshAndGetFieldTrialOverridesWithActiveOverride) { … }
TEST_F(FieldTrialInternalsUtilsTest,
RefreshAndGetFieldTrialOverridesBeforeRestart) { … }
TEST_F(FieldTrialInternalsUtilsTest,
RefreshAndGetFieldTrialOverridesStudyNoLongerExists) { … }
TEST_F(FieldTrialInternalsUtilsTest,
RefreshAndGetFieldTrialOverridesDoesNotRestoreExpiredOverrides) { … }
}
}