#include "storage/browser/file_system/sandbox_file_stream_writer.h"
#include <stdint.h>
#include <memory>
#include <string>
#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/task/single_thread_task_runner.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "components/services/storage/public/cpp/buckets/bucket_info.h"
#include "components/services/storage/public/cpp/buckets/constants.h"
#include "components/services/storage/public/cpp/quota_error_or.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "storage/browser/file_system/file_stream_reader.h"
#include "storage/browser/file_system/file_stream_test_utils.h"
#include "storage/browser/file_system/file_stream_writer.h"
#include "storage/browser/file_system/file_stream_writer_test.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/browser/test/async_file_test_helper.h"
#include "storage/browser/test/mock_quota_manager_proxy.h"
#include "storage/browser/test/mock_special_storage_policy.h"
#include "storage/browser/test/quota_manager_proxy_sync.h"
#include "storage/browser/test/test_file_system_context.h"
#include "storage/common/file_system/file_system_types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace storage {
namespace {
const char kURLOrigin[] = …;
}
class SandboxFileStreamWriterTest : public FileStreamWriterTest { … };
TEST_F(SandboxFileStreamWriterTest, Test_Quota_DefaultBucketCreated) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_OK) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_WritePastEnd) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_NoSpace) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_NoSpace_PartialWrite) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_Negative) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_WritePastEndTwice_OK) { … }
TEST_F(SandboxFileStreamWriterTest, Quota_WritePastEndTwice_NoSpace) { … }
INSTANTIATE_TYPED_TEST_SUITE_P(…);
class SandboxFileStreamWriterIncognitoTest
: public SandboxFileStreamWriterTest { … };
TEST_F(SandboxFileStreamWriterIncognitoTest, Test_Quota_DefaultBucketCreated) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_OK) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_WritePastEnd) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_NoSpace) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_NoSpace_PartialWrite) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_Negative) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_WritePastEndTwice_OK) { … }
TEST_F(SandboxFileStreamWriterIncognitoTest, Quota_WritePastEndTwice_NoSpace) { … }
INSTANTIATE_TYPED_TEST_SUITE_P(…);
}