chromium/storage/browser/blob/blob_builder_from_stream_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 "storage/browser/blob/blob_builder_from_stream.h"

#include <algorithm>

#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/rand_util.h"
#include "base/run_loop.h"
#include "base/task/thread_pool.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "mojo/public/cpp/system/string_data_source.h"
#include "storage/browser/blob/blob_data_builder.h"
#include "storage/browser/blob/blob_data_item.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/test/fake_progress_client.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace storage {

namespace {

constexpr size_t kTestBlobStorageMaxBytesDataItemSize =;
constexpr size_t kTestBlobStorageMaxBlobMemorySize =;
constexpr uint64_t kTestBlobStorageMinFileSizeBytes =;
constexpr uint64_t kTestBlobStorageMaxFileSizeBytes =;
constexpr uint64_t kTestBlobStorageMaxDiskSpace =;

enum class LengthHintTestType {};

}  // namespace

class BlobBuilderFromStreamTestWithDelayedLimits
    : public testing::TestWithParam<LengthHintTestType> {};

class BlobBuilderFromStreamTest
    : public BlobBuilderFromStreamTestWithDelayedLimits {};

TEST_P(BlobBuilderFromStreamTest, CallbackCalledOnAbortBeforeDeletion) {}

TEST_P(BlobBuilderFromStreamTest, EmptyStream) {}

TEST_P(BlobBuilderFromStreamTest, SmallStream) {}

TEST_P(BlobBuilderFromStreamTest, MediumStream) {}

TEST_P(BlobBuilderFromStreamTest, LargeStream) {}

TEST_P(BlobBuilderFromStreamTest, TooLargeForQuota) {}

TEST_P(BlobBuilderFromStreamTest, TooLargeForQuotaAndNoDisk) {}

// The next two tests are similar to the previous two, except they don't send
// any data over the datapipe, but should still result in failure as the
// initial memory/file allocation should fail.
TEST_F(BlobBuilderFromStreamTest, HintTooLargeForQuota) {}

TEST_F(BlobBuilderFromStreamTest, HintTooLargeForQuotaAndNoDisk) {}

TEST_P(BlobBuilderFromStreamTest, ProgressEvents) {}

INSTANTIATE_TEST_SUITE_P();

TEST_F(BlobBuilderFromStreamTestWithDelayedLimits, LargeStream) {}

}  // namespace storage