chromium/components/sync_preferences/preferences_merge_helper_unittest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Tests for MergePreference() exists in pref_model_associator_unittest.cc.
// TODO(crbug.com/40256874): Move those tests here.

}  // namespace
}  // namespace sync_preferences