#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/metrics/field_trials_provider.h"
#include <string_view>
#include "base/metrics/field_trial.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/platform_thread.h"
#include "components/variations/active_field_trials.h"
#include "components/variations/synthetic_trial_registry.h"
#include "components/variations/synthetic_trials.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/system_profile.pb.h"
ActiveGroup;
namespace variations {
namespace {
constexpr const char* kSuffix = …;
const ActiveGroup kFieldTrials[] = …;
const ActiveGroup kSyntheticFieldTrials[] = …;
ActiveGroupId ToActiveGroupId(ActiveGroup active_group,
std::string suffix = "");
const ActiveGroupId kFieldTrialIds[] = …;
const ActiveGroupId kAllTrialIds[] = …;
const ActiveGroupId kAllTrialIdsWithSuffixes[] = …;
void CheckFieldTrialsInSystemProfile(
const metrics::SystemProfileProto& system_profile,
const ActiveGroupId* expected) { … }
ActiveGroupId ToActiveGroupId(ActiveGroup active_group, std::string suffix) { … }
}
class FieldTrialsProviderTest : public ::testing::Test { … };
TEST_F(FieldTrialsProviderTest, ProvideSyntheticTrials) { … }
TEST_F(FieldTrialsProviderTest, NoSyntheticTrials) { … }
TEST_F(FieldTrialsProviderTest, ProvideCurrentSessionData) { … }
TEST_F(FieldTrialsProviderTest, GetAndWriteFieldTrialsWithSuffixes) { … }
}