Add GetNativeHandle() to wxWebSession and wxWebRequest
This allows to retrieve the handles used internally in order to do something not supported by the public API yet.
This commit is contained in:
@@ -144,6 +144,33 @@ TEST_CASE_METHOD(RequestFixture,
|
||||
CHECK( request.GetBytesReceived() == 65536 );
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(RequestFixture,
|
||||
"WebRequest::Get::Simple", "[net][webrequest][get]")
|
||||
{
|
||||
if ( !InitBaseURL() )
|
||||
return;
|
||||
|
||||
// Note that the session may be initialized on demand, so don't check the
|
||||
// native handle before actually using it.
|
||||
wxWebSession& session = wxWebSession::GetDefault();
|
||||
REQUIRE( session.IsOpened() );
|
||||
|
||||
// Request is not initialized yet.
|
||||
CHECK( !request.IsOk() );
|
||||
CHECK( !request.GetNativeHandle() );
|
||||
|
||||
Create("/status/200");
|
||||
CHECK( request.IsOk() );
|
||||
CHECK( session.GetNativeHandle() );
|
||||
|
||||
// Note that the request must be started to have a valid native handle.
|
||||
request.Start();
|
||||
CHECK( request.GetNativeHandle() );
|
||||
RunLoopWithTimeout();
|
||||
CHECK( request.GetState() == wxWebRequest::State_Completed );
|
||||
CHECK( request.GetResponse().GetStatus() == 200 );
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(RequestFixture,
|
||||
"WebRequest::Get::String", "[net][webrequest][get]")
|
||||
{
|
||||
|
Reference in New Issue
Block a user