#include "chrome/browser/sync/test/integration/preferences_helper.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/notreached.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/sync/base/data_type.h"
#include "components/sync/protocol/sync_entity.pb.h"
test;
namespace preferences_helper {
PrefService* GetPrefs(int index) { … }
user_prefs::PrefRegistrySyncable* GetRegistry(Profile* profile) { … }
void ChangeBooleanPref(int index, const char* pref_name) { … }
void ChangeIntegerPref(int index, const char* pref_name, int new_value) { … }
void ChangeStringPref(int index,
const char* pref_name,
const std::string& new_value) { … }
void ClearPref(int index, const char* pref_name) { … }
void ChangeListPref(int index,
const char* pref_name,
const base::Value::List& new_value) { … }
bool BooleanPrefMatches(const char* pref_name) { … }
bool IntegerPrefMatches(const char* pref_name) { … }
bool StringPrefMatches(const char* pref_name) { … }
bool ClearedPrefMatches(const char* pref_name) { … }
bool ListPrefMatches(const char* pref_name) { … }
const sync_pb::PreferenceSpecifics& GetPreferenceFromEntity(
syncer::DataType data_type,
const sync_pb::SyncEntity& entity) { … }
std::optional<sync_pb::PreferenceSpecifics> GetPreferenceInFakeServer(
syncer::DataType data_type,
const std::string& pref_name,
fake_server::FakeServer* fake_server) { … }
std::string ConvertPrefValueToValueInSpecifics(const base::Value& value) { … }
}
BooleanPrefValueChecker::BooleanPrefValueChecker(PrefService* pref_service,
const char* path,
bool expected_value)
: … { … }
BooleanPrefValueChecker::~BooleanPrefValueChecker() = default;
bool BooleanPrefValueChecker::IsExitConditionSatisfied(std::ostream* os) { … }
PrefMatchChecker::PrefMatchChecker(const char* path) : … { … }
PrefMatchChecker::~PrefMatchChecker() = default;
const char* PrefMatchChecker::GetPath() const { … }
void PrefMatchChecker::RegisterPrefListener(PrefService* pref_service) { … }
ListPrefMatchChecker::ListPrefMatchChecker(const char* path)
: … { … }
bool ListPrefMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
BooleanPrefMatchChecker::BooleanPrefMatchChecker(const char* path)
: … { … }
bool BooleanPrefMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
IntegerPrefMatchChecker::IntegerPrefMatchChecker(const char* path)
: … { … }
bool IntegerPrefMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
StringPrefMatchChecker::StringPrefMatchChecker(const char* path)
: … { … }
bool StringPrefMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
ClearedPrefMatchChecker::ClearedPrefMatchChecker(const char* path)
: … { … }
bool ClearedPrefMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
FakeServerPrefMatchesValueChecker::FakeServerPrefMatchesValueChecker(
syncer::DataType data_type,
const std::string& pref_name,
const std::string& expected_value)
: … { … }
bool FakeServerPrefMatchesValueChecker::IsExitConditionSatisfied(
std::ostream* os) { … }