chromium/components/leveldb_proto/internal/shared_proto_database_unittest.cc

// Copyright 2018 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/leveldb_proto/internal/shared_proto_database.h"

#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
#include "components/leveldb_proto/internal/proto_leveldb_wrapper.h"
#include "components/leveldb_proto/testing/proto/test_db.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;

namespace leveldb_proto {

namespace {

inline void GetClientFromTaskRunner(SharedProtoDatabase* db,
                                    ProtoDbType db_type,
                                    base::OnceClosure closure) {}

}  // namespace

class MockSharedDb : public SharedProtoDatabase {};

class SharedProtoDatabaseTest : public testing::Test {};

TEST_F(SharedProtoDatabaseTest, CreateClient_SucceedsWithCreate) {}

TEST_F(SharedProtoDatabaseTest, CreateClient_FailsWithoutCreate) {}

TEST_F(SharedProtoDatabaseTest,
       CreateClient_SucceedsWithoutCreateIfAlreadyCreated) {}

TEST_F(SharedProtoDatabaseTest, GetClient_DifferentThreads) {}

// If not attempt to create the db, kInvalidOperation will be returned in the
// callback.
TEST_F(SharedProtoDatabaseTest, InitNotCreateDb) {}

// If two initialize calls with different create_if_missing parameter arrive at
// the same time, the shared db will be created.
TEST_F(SharedProtoDatabaseTest, InitWithDifferentCreateIfMissing) {}

// Tests that the shared DB's destructor behaves appropriately once the
// backing LevelDB has been initialized on another thread.
TEST_F(SharedProtoDatabaseTest, TestDBDestructionAfterInit) {}

TEST_F(SharedProtoDatabaseTest, CancelDeleteObsoleteClients) {}

TEST_F(SharedProtoDatabaseTest, DeleteObsoleteClients) {}

}  // namespace leveldb_proto