chromium/components/sync/model/data_type_store_backend_unittest.cc

// Copyright 2015 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/model/data_type_store_backend.h"

#include <utility>

#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/task_environment.h"
#include "components/sync/protocol/data_type_store_schema_descriptor.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
#include "third_party/leveldatabase/src/include/leveldb/options.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"

UnorderedElementsAre;

namespace syncer {
namespace {

class DataTypeStoreBackendTest : public testing::Test {};

// Test that after record is written to backend it can be read back even after
// backend is destroyed and recreated in the same environment.
TEST_F(DataTypeStoreBackendTest, WriteThenRead) {}

// Test that ReadAllRecordsWithPrefix correclty filters records by prefix.
TEST_F(DataTypeStoreBackendTest, ReadAllRecordsWithPrefix) {}

// Test that deleted records are correctly marked as milling in results of
// ReadRecordsWithPrefix.
TEST_F(DataTypeStoreBackendTest, ReadDeletedRecord) {}

// Test that DeleteDataAndMetadataForPrefix correctly deletes records by prefix.
TEST_F(DataTypeStoreBackendTest, DeleteDataAndMetadataForPrefix) {}

// Test that initializing the database migrates it to the latest schema version.
TEST_F(DataTypeStoreBackendTest, MigrateNoSchemaVersionToLatestVersionTest) {}

// Test that the 0 to 1 migration succeeds and sets the schema version to 1.
TEST_F(DataTypeStoreBackendTest, Migrate0To1Test) {}

// Test that migration to an unknown version fails
TEST_F(DataTypeStoreBackendTest, MigrateWithHigherExistingVersionFails) {}

TEST_F(DataTypeStoreBackendTest, MigrateReadingListFromLocalToAccount) {}

TEST_F(DataTypeStoreBackendTest,
       MigrateReadingListFromLocalToAccount_Idempotent) {}

// Tests that initializing store after corruption triggers recovery and results
// in successful store initialization.
TEST_F(DataTypeStoreBackendTest, RecoverAfterCorruption) {}

}  // namespace
}  // namespace syncer