chromium/components/sync_bookmarks/local_bookmark_model_merger_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_bookmarks/local_bookmark_model_merger.h"

#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "base/strings/utf_ostream_operators.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/sync/base/features.h"
#include "components/sync_bookmarks/bookmark_model_view.h"
#include "components/sync_bookmarks/test_bookmark_model_view.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "url/gurl.h"

namespace sync_bookmarks {
namespace {

ElementsAre;
IsEmpty;
Ne;

MATCHER_P2(MatchesUrl, title, url, "") {}

MATCHER_P2(MatchesFolder, title, children_matcher, "") {}

MATCHER_P(HasUuid, uuid, "") {}

MATCHER_P3(MatchesUrlWithUuid, title, url, uuid, "") {}

MATCHER_P3(MatchesFolderWithUuid, title, uuid, children_matcher, "") {}

// Test class to build bookmark URLs conveniently and compactly in tests.
class UrlBuilder {};

// Test class to build bookmark folders and compactly in tests.
class FolderBuilder {};

std::unique_ptr<TestBookmarkModelView> BuildLocalModel(
    const std::vector<FolderBuilder::FolderOrUrl>& children_of_bookmark_bar) {}

std::unique_ptr<TestBookmarkModelView> BuildAccountModel(
    const std::vector<FolderBuilder::FolderOrUrl>& children_of_bookmark_bar) {}

class LocalBookmarkModelMergerTest : public testing::Test {};

TEST_F(LocalBookmarkModelMergerTest,
       ShouldUploadEntireLocalModelIfAccountModelEmpty) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldIgnoreManagedNodes) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldUploadLocalUuid) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldNotUploadDuplicateBySemantics) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldMergeLocalAndAccountModels) {}

// This tests that truncated titles produced by legacy clients are properly
// matched.
TEST_F(LocalBookmarkModelMergerTest,
       ShouldMergeLocalAndAccountNodesWhenAccountHasLegacyTruncatedTitle) {}

// This test checks that local node with truncated title will merge with account
// node which has full title.
TEST_F(LocalBookmarkModelMergerTest,
       ShouldMergeLocalAndAccountNodesWhenLocalHasLegacyTruncatedTitle) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldMergeBookmarkByUuid) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldMergeBookmarkByUuidDespiteDifferentParent) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldNotMergeBySemanticsIfDifferentParent) {}

TEST_F(LocalBookmarkModelMergerTest, ShouldMergeFolderByUuidAndNotSemantics) {}

TEST_F(
    LocalBookmarkModelMergerTest,
    ShouldIgnoreFolderSemanticsMatchAndLaterMatchByUuidWithSemanticsNodeFirst) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldIgnoreFolderSemanticsMatchAndLaterMatchByUuidWithUuidNodeFirst) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldReplaceBookmarkUuidWithConflictingURLs) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldReplaceBookmarkUuidWithConflictingTypes) {}

TEST_F(LocalBookmarkModelMergerTest,
       ShouldReplaceBookmarkUuidWithConflictingTypesAndLocalChildren) {}

}  // namespace

}  // namespace sync_bookmarks