#include "content/browser/private_aggregation/private_aggregation_budget_storage.h"
#include <memory>
#include <utility>
#include "base/check_op.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/clamped_math.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "content/browser/private_aggregation/proto/private_aggregation_budgets.pb.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
constexpr char kExampleSerializedOrigin[] = …;
}
class PrivateAggregationBudgetStorageTest : public testing::Test { … };
TEST_F(PrivateAggregationBudgetStorageTest, DatabaseInitialization) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
StorageDirectoryAlreadyCreated_StillInitializes) { … }
TEST_F(PrivateAggregationBudgetStorageTest, DbPathCorrupt_FailsToInitialize) { … }
TEST_F(PrivateAggregationBudgetStorageTest, InMemory_StillInitializes) { … }
TEST_F(PrivateAggregationBudgetStorageTest, DatabaseReopened_DataPersisted) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
DatabaseClosedBeforeFlush_DataPersisted) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
InMemoryDatabaseReopened_DataNotPersisted) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
SchemaVersionChanged_DatabaseRazed) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
StorageDestroyedImmediatelyAfterInitialization_DoesNotCrash) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
StorageShutdownImmediatelyAfterCreation_DoesNotCrash) { … }
TEST_F(PrivateAggregationBudgetStorageTest,
StorageShutdownImmediatelyAfterInitialization_DoesNotCrash) { … }
}