chromium/storage/browser/database/database_tracker_unittest.cc

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

#include "storage/browser/database/database_tracker.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "storage/browser/quota/quota_client_type.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/common/database/database_identifier.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
#include "third_party/sqlite/sqlite3.h"

namespace storage {

const char kOrigin1Url[] =;
const char kOrigin2Url[] =;

class TestObserver : public DatabaseTracker::Observer {};

void CheckNotificationReceived(TestObserver* observer,
                               const std::string& expected_origin_identifier,
                               const std::u16string& expected_database_name,
                               int64_t expected_database_size) {}

// Must be destroyed on the sequence that called RegisterClient() most recently.
class TestQuotaManagerProxy : public QuotaManagerProxy {};

bool EnsureFileOfSize(const base::FilePath& file_path, int64_t length) {}

// We declare a helper class, and make it a friend of DatabaseTracker using
// the FORWARD_DECLARE_TEST macro, and we implement all tests we want to run as
// static methods of this class. Then we make our TEST() targets call these
// static functions. This allows us to run each test in normal mode and
// incognito mode without writing the same code twice.
class DatabaseTracker_TestHelper_Test {};

TEST(DatabaseTrackerTest, DeleteOpenDatabase) {}

TEST(DatabaseTrackerTest, DeleteOpenDatabaseIncognitoMode) {}

TEST(DatabaseTrackerTest, DatabaseTracker) {}

TEST(DatabaseTrackerTest, DatabaseTrackerIncognitoMode) {}

TEST(DatabaseTrackerTest, DatabaseTrackerQuotaIntegration) {}

TEST(DatabaseTrackerTest, DatabaseTrackerQuotaIntegrationIncognitoMode) {}

TEST(DatabaseTrackerTest, EmptyDatabaseNameIsValid) {}

TEST(DatabaseTrackerTest, HandleSqliteError) {}

}  // namespace storage