#include "components/variations/variations_test_utils.h"
#include "base/base64.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/time/time.h"
#include "components/metrics/clean_exit_beacon.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/variations/active_field_trials.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/field_trial_config/fieldtrial_testing_config.h"
#include "components/variations/hashing.h"
#include "components/variations/pref_names.h"
#include "components/variations/proto/client_variations.pb.h"
#include "components/variations/synthetic_trial_registry.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_switches.h"
#include "third_party/zlib/google/compression_utils.h"
namespace variations {
namespace {
const char* kTestSeed_StudyNames[] = …;
const char kTestSeed_Base64UncompressedData[] = …;
const char kTestSeed_Base64CompressedData[] = …;
const char kTestSeed_Base64Signature[] = …;
const char* kCrashingSeed_StudyNames[] = …;
const char kCrashingSeed_Base64UncompressedData[] = …;
const char kCrashingSeed_Base64CompressedData[] = …;
const char kCrashingSeed_Base64Signature[] = …;
const Study::Platform array_kFieldTrialConfig_platforms_0[] = …;
const char* enable_features_0[] = …;
const FieldTrialTestingExperimentParams array_kFieldTrialConfig_params_0[] = …;
const FieldTrialTestingExperiment array_kFieldTrialConfig_experiments_0[] = …;
const FieldTrialTestingStudy array_kFieldTrialConfig_studies[] = …;
}
const SignedSeedData kTestSeedData{ … };
const SignedSeedData kCrashingSeedData{ … };
const SignedSeedPrefKeys kSafeSeedPrefKeys{ … };
const SignedSeedPrefKeys kRegularSeedPrefKeys{ … };
SignedSeedData::SignedSeedData(base::span<const char*> in_study_names,
const char* in_base64_uncompressed_data,
const char* in_base64_compressed_data,
const char* in_base64_signature)
: … { … }
SignedSeedData::~SignedSeedData() = default;
SignedSeedData::SignedSeedData(const SignedSeedData&) = default;
SignedSeedData::SignedSeedData(SignedSeedData&&) = default;
SignedSeedData& SignedSeedData::operator=(const SignedSeedData&) = default;
SignedSeedData& SignedSeedData::operator=(SignedSeedData&&) = default;
void DisableTestingConfig() { … }
void EnableTestingConfig() { … }
bool ExtractVariationIds(const std::string& variations,
std::set<VariationID>* variation_ids,
std::set<VariationID>* trigger_ids) { … }
scoped_refptr<base::FieldTrial> CreateTrialAndAssociateId(
const std::string& trial_name,
const std::string& default_group_name,
IDCollectionKey key,
VariationID id) { … }
void SimulateCrash(PrefService* local_state) { … }
void WriteSeedData(PrefService* local_state,
const SignedSeedData& seed_data,
const SignedSeedPrefKeys& pref_keys) { … }
bool FieldTrialListHasAllStudiesFrom(const SignedSeedData& seed_data) { … }
void ResetVariations() { … }
const FieldTrialTestingConfig kTestingConfig = …;
std::unique_ptr<ClientFilterableState> CreateDummyClientFilterableState() { … }
MockEntropyProviders::MockEntropyProviders(
MockEntropyProviders::Results results,
uint32_t low_entropy_domain)
: … { … }
MockEntropyProviders::~MockEntropyProviders() = default;
const base::FieldTrial::EntropyProvider& MockEntropyProviders::low_entropy()
const { … }
const base::FieldTrial::EntropyProvider& MockEntropyProviders::default_entropy()
const { … }
const base::FieldTrial::EntropyProvider& MockEntropyProviders::limited_entropy()
const { … }
std::string GZipAndB64EncodeToHexString(const VariationsSeed& seed) { … }
bool ContainsTrialName(const std::vector<ActiveGroupId>& active_group_ids,
std::string_view trial_name) { … }
bool ContainsTrialAndGroupName(
const std::vector<ActiveGroupId>& active_group_ids,
std::string_view trial_name,
std::string_view group_name) { … }
}