#include "components/cronet/native/generated/cronet.idl_c.h"
#include "base/check.h"
#include "testing/gtest/include/gtest/gtest.h"
class Cronet_BufferTest : public ::testing::Test { … };
namespace {
void TestCronet_Buffer_InitWithDataAndCallback(
Cronet_BufferPtr self,
Cronet_RawDataPtr data,
uint64_t size,
Cronet_BufferCallbackPtr callback) { … }
void TestCronet_Buffer_InitWithAlloc(Cronet_BufferPtr self, uint64_t size) { … }
uint64_t TestCronet_Buffer_GetSize(Cronet_BufferPtr self) { … }
Cronet_RawDataPtr TestCronet_Buffer_GetData(Cronet_BufferPtr self) { … }
}
TEST_F(Cronet_BufferTest, TestCreate) { … }
class Cronet_BufferCallbackTest : public ::testing::Test { … };
namespace {
void TestCronet_BufferCallback_OnDestroy(Cronet_BufferCallbackPtr self,
Cronet_BufferPtr buffer) { … }
}
TEST_F(Cronet_BufferCallbackTest, TestCreate) { … }
class Cronet_RunnableTest : public ::testing::Test { … };
namespace {
void TestCronet_Runnable_Run(Cronet_RunnablePtr self) { … }
}
TEST_F(Cronet_RunnableTest, TestCreate) { … }
class Cronet_ExecutorTest : public ::testing::Test { … };
namespace {
void TestCronet_Executor_Execute(Cronet_ExecutorPtr self,
Cronet_RunnablePtr command) { … }
}
TEST_F(Cronet_ExecutorTest, TestCreate) { … }
class Cronet_EngineTest : public ::testing::Test { … };
namespace {
Cronet_RESULT TestCronet_Engine_StartWithParams(Cronet_EnginePtr self,
Cronet_EngineParamsPtr params) { … }
bool TestCronet_Engine_StartNetLogToFile(Cronet_EnginePtr self,
Cronet_String file_name,
bool log_all) { … }
void TestCronet_Engine_StopNetLog(Cronet_EnginePtr self) { … }
Cronet_RESULT TestCronet_Engine_Shutdown(Cronet_EnginePtr self) { … }
Cronet_String TestCronet_Engine_GetVersionString(Cronet_EnginePtr self) { … }
Cronet_String TestCronet_Engine_GetDefaultUserAgent(Cronet_EnginePtr self) { … }
void TestCronet_Engine_AddRequestFinishedListener(
Cronet_EnginePtr self,
Cronet_RequestFinishedInfoListenerPtr listener,
Cronet_ExecutorPtr executor) { … }
void TestCronet_Engine_RemoveRequestFinishedListener(
Cronet_EnginePtr self,
Cronet_RequestFinishedInfoListenerPtr listener) { … }
}
TEST_F(Cronet_EngineTest, TestCreate) { … }
class Cronet_UrlRequestStatusListenerTest : public ::testing::Test { … };
namespace {
void TestCronet_UrlRequestStatusListener_OnStatus(
Cronet_UrlRequestStatusListenerPtr self,
Cronet_UrlRequestStatusListener_Status status) { … }
}
TEST_F(Cronet_UrlRequestStatusListenerTest, TestCreate) { … }
class Cronet_UrlRequestCallbackTest : public ::testing::Test { … };
namespace {
void TestCronet_UrlRequestCallback_OnRedirectReceived(
Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info,
Cronet_String new_location_url) { … }
void TestCronet_UrlRequestCallback_OnResponseStarted(
Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info) { … }
void TestCronet_UrlRequestCallback_OnReadCompleted(
Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info,
Cronet_BufferPtr buffer,
uint64_t bytes_read) { … }
void TestCronet_UrlRequestCallback_OnSucceeded(
Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info) { … }
void TestCronet_UrlRequestCallback_OnFailed(Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info,
Cronet_ErrorPtr error) { … }
void TestCronet_UrlRequestCallback_OnCanceled(Cronet_UrlRequestCallbackPtr self,
Cronet_UrlRequestPtr request,
Cronet_UrlResponseInfoPtr info) { … }
}
TEST_F(Cronet_UrlRequestCallbackTest, TestCreate) { … }
class Cronet_UploadDataSinkTest : public ::testing::Test { … };
namespace {
void TestCronet_UploadDataSink_OnReadSucceeded(Cronet_UploadDataSinkPtr self,
uint64_t bytes_read,
bool final_chunk) { … }
void TestCronet_UploadDataSink_OnReadError(Cronet_UploadDataSinkPtr self,
Cronet_String error_message) { … }
void TestCronet_UploadDataSink_OnRewindSucceeded(
Cronet_UploadDataSinkPtr self) { … }
void TestCronet_UploadDataSink_OnRewindError(Cronet_UploadDataSinkPtr self,
Cronet_String error_message) { … }
}
TEST_F(Cronet_UploadDataSinkTest, TestCreate) { … }
class Cronet_UploadDataProviderTest : public ::testing::Test { … };
namespace {
int64_t TestCronet_UploadDataProvider_GetLength(
Cronet_UploadDataProviderPtr self) { … }
void TestCronet_UploadDataProvider_Read(
Cronet_UploadDataProviderPtr self,
Cronet_UploadDataSinkPtr upload_data_sink,
Cronet_BufferPtr buffer) { … }
void TestCronet_UploadDataProvider_Rewind(
Cronet_UploadDataProviderPtr self,
Cronet_UploadDataSinkPtr upload_data_sink) { … }
void TestCronet_UploadDataProvider_Close(Cronet_UploadDataProviderPtr self) { … }
}
TEST_F(Cronet_UploadDataProviderTest, TestCreate) { … }
class Cronet_UrlRequestTest : public ::testing::Test { … };
namespace {
Cronet_RESULT TestCronet_UrlRequest_InitWithParams(
Cronet_UrlRequestPtr self,
Cronet_EnginePtr engine,
Cronet_String url,
Cronet_UrlRequestParamsPtr params,
Cronet_UrlRequestCallbackPtr callback,
Cronet_ExecutorPtr executor) { … }
Cronet_RESULT TestCronet_UrlRequest_Start(Cronet_UrlRequestPtr self) { … }
Cronet_RESULT TestCronet_UrlRequest_FollowRedirect(Cronet_UrlRequestPtr self) { … }
Cronet_RESULT TestCronet_UrlRequest_Read(Cronet_UrlRequestPtr self,
Cronet_BufferPtr buffer) { … }
void TestCronet_UrlRequest_Cancel(Cronet_UrlRequestPtr self) { … }
bool TestCronet_UrlRequest_IsDone(Cronet_UrlRequestPtr self) { … }
void TestCronet_UrlRequest_GetStatus(
Cronet_UrlRequestPtr self,
Cronet_UrlRequestStatusListenerPtr listener) { … }
}
TEST_F(Cronet_UrlRequestTest, TestCreate) { … }
class Cronet_RequestFinishedInfoListenerTest : public ::testing::Test { … };
namespace {
void TestCronet_RequestFinishedInfoListener_OnRequestFinished(
Cronet_RequestFinishedInfoListenerPtr self,
Cronet_RequestFinishedInfoPtr request_info,
Cronet_UrlResponseInfoPtr response_info,
Cronet_ErrorPtr error) { … }
}
TEST_F(Cronet_RequestFinishedInfoListenerTest, TestCreate) { … }