chromium/components/cronet/native/test/test_upload_data_provider.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 "components/cronet/native/test/test_upload_data_provider.h"

#include "base/functional/bind.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

// Helper class that runs base::OnceClosure.
class TestRunnable {};

TestRunnable::TestRunnable(base::OnceClosure task) :{}

TestRunnable::~TestRunnable() = default;

// static
Cronet_RunnablePtr TestRunnable::CreateRunnable(base::OnceClosure task) {}

// static
void TestRunnable::Run(Cronet_RunnablePtr self) {}

}  // namespace

namespace cronet {
// Various test utility functions for testing Cronet.
namespace test {

TestUploadDataProvider::TestUploadDataProvider(
    SuccessCallbackMode success_callback_mode,
    Cronet_ExecutorPtr executor)
    :{}

TestUploadDataProvider::~TestUploadDataProvider() = default;

Cronet_UploadDataProviderPtr
TestUploadDataProvider::CreateUploadDataProvider() {}

void TestUploadDataProvider::AddRead(std::string read) {}

void TestUploadDataProvider::SetReadFailure(int read_fail_index,
                                            FailMode read_fail_mode) {}

void TestUploadDataProvider::SetRewindFailure(FailMode rewind_fail_mode) {}

void TestUploadDataProvider::SetReadCancel(int read_cancel_index,
                                           CancelMode read_cancel_mode) {}

void TestUploadDataProvider::SetRewindCancel(CancelMode rewind_cancel_mode) {}

int64_t TestUploadDataProvider::GetLength() const {}

int64_t TestUploadDataProvider::GetUploadedLength() const {}

void TestUploadDataProvider::Read(Cronet_UploadDataSinkPtr upload_data_sink,
                                  Cronet_BufferPtr buffer) {}

void TestUploadDataProvider::Rewind(Cronet_UploadDataSinkPtr upload_data_sink) {}

void TestUploadDataProvider::PostTaskToExecutor(base::OnceClosure task) {}

void TestUploadDataProvider::AssertIdle() const {}

bool TestUploadDataProvider::MaybeFailRead(
    int read_index,
    Cronet_UploadDataSinkPtr upload_data_sink) {}

bool TestUploadDataProvider::MaybeFailRewind(
    Cronet_UploadDataSinkPtr upload_data_sink) {}

void TestUploadDataProvider::MaybeCancelRequest(CancelMode cancel_mode) {}

void TestUploadDataProvider::Close() {}

void TestUploadDataProvider::AssertClosed() {}

/* static */
TestUploadDataProvider* TestUploadDataProvider::GetThis(
    Cronet_UploadDataProviderPtr self) {}

/* static */
int64_t TestUploadDataProvider::GetLength(Cronet_UploadDataProviderPtr self) {}

/* static */
void TestUploadDataProvider::Read(Cronet_UploadDataProviderPtr self,
                                  Cronet_UploadDataSinkPtr upload_data_sink,
                                  Cronet_BufferPtr buffer) {}

/* static */
void TestUploadDataProvider::Rewind(Cronet_UploadDataProviderPtr self,
                                    Cronet_UploadDataSinkPtr upload_data_sink) {}

/* static */
void TestUploadDataProvider::Close(Cronet_UploadDataProviderPtr self) {}

}  // namespace test
}  // namespace cronet