chromium/net/base/chunked_upload_data_stream_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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/base/chunked_upload_data_stream.h"

#include <memory>
#include <string>

#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_data_stream.h"
#include "net/log/net_log_with_source.h"
#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

IsError;
IsOk;

namespace net {

namespace {

constexpr char kTestData[] =;
constexpr size_t kTestDataSize =;
constexpr size_t kTestBufferSize =;  // 16KB.

}  // namespace

// Reads data once from the upload data stream, and returns the data as string.
// Expects the read to succeed synchronously.
std::string ReadSync(UploadDataStream* stream, int buffer_size) {}

// Check the case data is added after the first read attempt.
TEST(ChunkedUploadDataStreamTest, AppendOnce) {}

TEST(ChunkedUploadDataStreamTest, AppendOnceBeforeRead) {}

TEST(ChunkedUploadDataStreamTest, AppendOnceBeforeInit) {}

TEST(ChunkedUploadDataStreamTest, MultipleAppends) {}

TEST(ChunkedUploadDataStreamTest, MultipleAppendsBetweenReads) {}

// Checks that multiple reads can be merged.
TEST(ChunkedUploadDataStreamTest, MultipleAppendsBeforeInit) {}

TEST(ChunkedUploadDataStreamTest, MultipleReads) {}

TEST(ChunkedUploadDataStreamTest, EmptyUpload) {}

TEST(ChunkedUploadDataStreamTest, EmptyUploadEndedBeforeInit) {}

TEST(ChunkedUploadDataStreamTest, RewindAfterComplete) {}

TEST(ChunkedUploadDataStreamTest, RewindWhileReading) {}

// Check the behavior of ChunkedUploadDataStream::Writer.
TEST(ChunkedUploadDataStreamTest, ChunkedUploadDataStreamWriter) {}

}  // namespace net