#include "components/bookmarks/browser/bookmark_codec.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_string_value_serializer.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
#include "base/values.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_uuids.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace bookmarks {
namespace {
ASCIIToUTF16;
ElementsAre;
Pair;
const char16_t kUrl1Title[] = …;
const char kUrl1Url[] = …;
const char16_t kUrl2Title[] = …;
const char kUrl2Url[] = …;
const char16_t kUrl3Title[] = …;
const char kUrl3Url[] = …;
const char16_t kUrl4Title[] = …;
const char kUrl4Url[] = …;
const char16_t kFolder1Title[] = …;
const char16_t kFolder2Title[] = …;
const base::FilePath& GetTestDataDir() { … }
BookmarkNode* AsMutable(const BookmarkNode* node) { … }
void AssertNodesEqual(const BookmarkNode* expected,
const BookmarkNode* actual) { … }
void AssertModelsEqual(BookmarkModel* expected, BookmarkModel* actual) { … }
}
class BookmarkCodecTest : public testing::Test { … };
TEST_F(BookmarkCodecTest, ChecksumEncodeDecodeTest) { … }
TEST_F(BookmarkCodecTest, ChecksumEncodeIdenticalModelsTest) { … }
TEST_F(BookmarkCodecTest, ChecksumManualEditTest) { … }
TEST_F(BookmarkCodecTest, DecodeWithNoId) { … }
TEST_F(BookmarkCodecTest, ChecksumManualEditIDsTest) { … }
TEST_F(BookmarkCodecTest, PersistIDsTest) { … }
TEST_F(BookmarkCodecTest, DecodeModel) { … }
TEST_F(BookmarkCodecTest, CannotDecodeModelWithoutMobileBookmarks) { … }
TEST_F(BookmarkCodecTest, DecodeWithDuplicateIds) { … }
TEST_F(BookmarkCodecTest, DecodeWithAlreadyAssignedIds) { … }
TEST_F(BookmarkCodecTest, DecodeWithDuplicateIdsAndAlreadyAssignedIds) { … }
TEST_F(BookmarkCodecTest, EncodeAndDecodeMetaInfo) { … }
TEST_F(BookmarkCodecTest, CanDecodeMetaInfoAsString) { … }
TEST_F(BookmarkCodecTest, EncodeAndDecodeSyncMetadata) { … }
TEST_F(BookmarkCodecTest, EncodeAndDecodeSyncMetadataWithoutPermanentNodes) { … }
TEST_F(BookmarkCodecTest, EncodeAndDecodeGuid) { … }
TEST_F(BookmarkCodecTest, ReassignEmptyUuid) { … }
TEST_F(BookmarkCodecTest, ReassignMissingUuid) { … }
TEST_F(BookmarkCodecTest, ReassignInvalidUuid) { … }
TEST_F(BookmarkCodecTest, ReassignDuplicateUuid) { … }
TEST_F(BookmarkCodecTest, ReassignBannedUuid) { … }
TEST_F(BookmarkCodecTest, ReassignPermanentNodeDuplicateUuid) { … }
TEST_F(BookmarkCodecTest, CanonicalizeUuid) { … }
}