#include "components/cronet/native/test/test_upload_data_provider.h"
#include "base/functional/bind.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
class TestRunnable { … };
TestRunnable::TestRunnable(base::OnceClosure task) : … { … }
TestRunnable::~TestRunnable() = default;
Cronet_RunnablePtr TestRunnable::CreateRunnable(base::OnceClosure task) { … }
void TestRunnable::Run(Cronet_RunnablePtr self) { … }
}
namespace 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() { … }
TestUploadDataProvider* TestUploadDataProvider::GetThis(
Cronet_UploadDataProviderPtr self) { … }
int64_t TestUploadDataProvider::GetLength(Cronet_UploadDataProviderPtr self) { … }
void TestUploadDataProvider::Read(Cronet_UploadDataProviderPtr self,
Cronet_UploadDataSinkPtr upload_data_sink,
Cronet_BufferPtr buffer) { … }
void TestUploadDataProvider::Rewind(Cronet_UploadDataProviderPtr self,
Cronet_UploadDataSinkPtr upload_data_sink) { … }
void TestUploadDataProvider::Close(Cronet_UploadDataProviderPtr self) { … }
}
}