#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/variations/study_filtering.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "client_filterable_state.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/processed_study.h"
#include "components/variations/variations_layers.h"
#include "components/variations/variations_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace variations {
namespace {
int64_t TimeToProtoTime(const base::Time& time) { … }
Study::Experiment* AddExperiment(const std::string& name,
int probability,
Study* study) { … }
std::vector<std::string> SplitFilterString(const std::string& input) { … }
ClientFilterableState ClientFilterableStateForGoogleGroups(
const base::flat_set<uint64_t> google_groups) { … }
}
TEST(VariationsStudyFilteringTest, CheckStudyChannel) { … }
TEST(VariationsStudyFilteringTest, CheckStudyFormFactor) { … }
TEST(VariationsStudyFilteringTest, CheckStudyLocale) { … }
TEST(VariationsStudyFilteringTest, CheckStudyPlatform) { … }
TEST(VariationsStudyFilteringTest, CheckStudyLowEndDevice) { … }
TEST(VariationsStudyFilteringTest, CheckStudyEnterprise) { … }
TEST(VariationsStudyFilteringTest, CheckStudyPolicyRestriction) { … }
TEST(VariationsStudyFilteringTest, CheckStudyStartDate) { … }
TEST(VariationsStudyFilteringTest, CheckStudyEndDate) { … }
TEST(VariationsStudyFilteringTest, CheckStudyOSVersion) { … }
TEST(VariationsStudyFilteringTest, CheckStudyMalformedOSVersion) { … }
TEST(VariationsStudyFilteringTest, CheckStudyVersion) { … }
TEST(VariationsStudyFilteringTest, CheckStudyHardwareClass) { … }
TEST(VariationsStudyFilteringTest, CheckStudyCountry) { … }
TEST(VariationsStudyFilteringTest, CheckStudyGoogleGroupFilterNotSet) { … }
TEST(VariationsStudyFilteringTest, CheckStudyGoogleGroupFilterSet) { … }
TEST(VariationsStudyFilteringTest, CheckStudyExcludeGoogleGroupFilterSet) { … }
TEST(VariationsStudyFilteringTest, CheckStudyBothGoogleGroupFiltersSet) { … }
TEST(VariationsStudyFilteringTest, FilterAndValidateStudies) { … }
TEST(VariationsStudyFilteringTest, FilterAndValidateStudiesWithBadFilters) { … }
TEST(VariationsStudyFilteringTest, FilterAndValidateStudiesWithBlankStudyName) { … }
TEST(VariationsStudyFilteringTest, FilterAndValidateStudiesWithCountry) { … }
TEST(VariationsStudyFilteringTest, GetClientCountryForStudy_Session) { … }
TEST(VariationsStudyFilteringTest, GetClientCountryForStudy_Permanent) { … }
TEST(VariationsStudyFilteringTest, ValidateStudy) { … }
}