#include "components/sync_preferences/preferences_merge_helper.h"
#include <unordered_map>
#include "base/json/json_reader.h"
#include "components/sync_preferences/pref_model_associator_client.h"
#include "components/sync_preferences/test_syncable_prefs_database.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace sync_preferences {
namespace {
const char kMergeableDictPref[] = …;
const char kMergeableListPref[] = …;
const TestSyncablePrefsDatabase::PrefsMap kSyncablePrefsDatabase = …;
TEST(PreferencesMergeHelperTest, MergeListValues) { … }
TEST(PreferencesMergeHelperTest, MergeDictionaryValues) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldAddNewValueToBothUpdates) { … }
TEST(PreferencesMergeHelperTest, UnmergeDictionaryValuesShouldRemoveValues) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldNotAddValuesWithNoUpdate) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldOnlyUpdateCommonKeyIfEffectiveValueChanges) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldAddUpdatedValuesToBothUpdates) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldUnmergeRecursively) { … }
TEST(
PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldUnmergeRecursivelyButShouldNotAddUnchangedValuesToOther) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldUnmergeRecursivelyAndAddUpdatedValuesToBoth) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldUnmergeRecursivelyAndAddNewKeysToBoth) { … }
TEST(PreferencesMergeHelperTest,
UnmergeDictionaryValuesShouldUnmergeRecursivelyAndRemoveMissingKeys) { … }
class TestPrefModelAssociatorClient : public PrefModelAssociatorClient { … };
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptLocalValueForMergeableDictPref) { … }
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptServerValueForMergeableDictPref) { … }
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptValuesForMergeableDictPref) { … }
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptLocalValueForMergeableListPref) { … }
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptServerValueForMergeableListPref) { … }
TEST(PreferencesMergeHelperTest,
ShouldHandleCorruptValuesForMergeableListPref) { … }
}
}