#include <stdint.h>
#include <memory>
#include <utility>
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "storage/browser/file_system/quota/open_file_handle.h"
#include "storage/browser/file_system/quota/quota_reservation.h"
#include "storage/browser/file_system/quota/quota_reservation_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace storage {
namespace {
const FileSystemType kType = …;
const int64_t kInitialFileSize = …;
ReserveQuotaCallback;
int64_t GetFileSize(const base::FilePath& path) { … }
void SetFileSize(const base::FilePath& path, int64_t size) { … }
class FakeBackend : public QuotaReservationManager::QuotaBackend { … };
class FakeWriter { … };
void ExpectSuccess(bool* done, base::File::Error error) { … }
void RefreshReservation(QuotaReservation* reservation, int64_t size) { … }
}
class QuotaReservationManagerTest : public testing::Test { … };
TEST_F(QuotaReservationManagerTest, BasicTest) { … }
TEST_F(QuotaReservationManagerTest, MultipleWriter) { … }
TEST_F(QuotaReservationManagerTest, MultipleClient) { … }
TEST_F(QuotaReservationManagerTest, ClientCrash) { … }
}