mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix NetworkService ServerTest.* failures and test name typo (see issue #2622).
Always return ERR_NONE and the response body if a CefURLRequest completes successfully, including for non-2xx status codes. This matches the behavior of the old network stack. To test: ServerTest.* tests pass with NetworkService enabled.
This commit is contained in:
@@ -211,11 +211,10 @@ class CefBrowserURLRequest::Context
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request_flags & UR_FLAG_NO_RETRY_ON_5XX) {
|
// Allow delivery of non-2xx response bodies.
|
||||||
// No retries is the default setting, so we don't need to configure that.
|
loader_->SetAllowHttpErrorResults(true);
|
||||||
// Allow delivery of non-2xx response bodies.
|
|
||||||
loader_->SetAllowHttpErrorResults(true);
|
if (!(request_flags & UR_FLAG_NO_RETRY_ON_5XX)) {
|
||||||
} else {
|
|
||||||
// Allow 2 retries on 5xx response or network change.
|
// Allow 2 retries on 5xx response or network change.
|
||||||
// TODO(network): Consider exposing configuration of max retries and/or
|
// TODO(network): Consider exposing configuration of max retries and/or
|
||||||
// RETRY_ON_NETWORK_CHANGE as a separate flag.
|
// RETRY_ON_NETWORK_CHANGE as a separate flag.
|
||||||
|
@@ -3057,7 +3057,7 @@ TEST(ResourceRequestHandlerTest, FilterPassThruReadAll) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pass through contents unchanged. Read limited input.
|
// Pass through contents unchanged. Read limited input.
|
||||||
TEST(ResouseRequestHandlerTest, FilterPassThruReadLimited) {
|
TEST(ResourceRequestHandlerTest, FilterPassThruReadLimited) {
|
||||||
CefRefPtr<ResponseFilterTestHandler> handler =
|
CefRefPtr<ResponseFilterTestHandler> handler =
|
||||||
new ResponseFilterTestHandler(new ResponseFilterPassThru(true));
|
new ResponseFilterTestHandler(new ResponseFilterPassThru(true));
|
||||||
handler->ExecuteTest();
|
handler->ExecuteTest();
|
||||||
|
@@ -952,6 +952,8 @@ class StaticHttpRequestRunner : public HttpTestRunner::RequestRunner {
|
|||||||
static scoped_ptr<HttpTestRunner::RequestRunner> Create500(
|
static scoped_ptr<HttpTestRunner::RequestRunner> Create500(
|
||||||
const std::string& path) {
|
const std::string& path) {
|
||||||
CefRefPtr<CefRequest> request = CreateTestServerRequest(path, "GET");
|
CefRefPtr<CefRequest> request = CreateTestServerRequest(path, "GET");
|
||||||
|
// Don't retry the request.
|
||||||
|
request->SetFlags(UR_FLAG_NO_RETRY_ON_5XX);
|
||||||
HttpServerResponse response(HttpServerResponse::TYPE_500);
|
HttpServerResponse response(HttpServerResponse::TYPE_500);
|
||||||
response.error_message = "Something went wrong!";
|
response.error_message = "Something went wrong!";
|
||||||
return make_scoped_ptr<HttpTestRunner::RequestRunner>(
|
return make_scoped_ptr<HttpTestRunner::RequestRunner>(
|
||||||
|
Reference in New Issue
Block a user