Allow a simple way to rest requesting the given URL in the test

This does nothing more than just running a GET request for the given
URL for testing purposes.
This commit is contained in:
Vadim Zeitlin
2021-01-11 02:30:43 +01:00
parent 9149a3725d
commit 252373e540

View File

@@ -287,6 +287,23 @@ TEST_CASE_METHOD(RequestFixture,
} }
} }
// This test is not run by default and has to be explicitly selected to run.
TEST_CASE_METHOD(RequestFixture,
"WebRequest::Manual", "[net][webrequest][auth][.]")
{
// Allow getting 8-bit strings from the environment correctly.
setlocale(LC_ALL, "");
wxString url;
if ( !wxGetEnv("WX_TEST_WEBREQUEST_URL", &url) )
{
FAIL("Specify WX_TEST_WEBREQUEST_URL");
}
CreateAbs(url);
Run(wxWebRequest::State_Completed, 0);
}
WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap); WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap);
namespace wxPrivate namespace wxPrivate