Commit 8b66f9ce authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

DevTools: report loadingFailed event for nav requests cancelled because of 204

Bug: 840962
Change-Id: I7df6c302cd13a2a0d8085b26cff4e2fa34f6aca0
Reviewed-on: https://chromium-review.googlesource.com/1054358Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557898}
parent d69a37bd
......@@ -1003,8 +1003,6 @@ void NavigationRequest::OnRequestFailed(
bool has_stale_copy_in_cache,
int net_error,
const base::Optional<net::SSLInfo>& ssl_info) {
RenderFrameDevToolsAgentHost::OnNavigationRequestFailed(*this, net_error);
NavigationRequest::OnRequestFailedInternal(has_stale_copy_in_cache, net_error,
ssl_info, false, base::nullopt);
}
......@@ -1018,6 +1016,8 @@ void NavigationRequest::OnRequestFailedInternal(
DCHECK(state_ == STARTED || state_ == RESPONSE_STARTED);
DCHECK(!(net_error == net::ERR_ABORTED && error_page_content.has_value()));
RenderFrameDevToolsAgentHost::OnNavigationRequestFailed(*this, net_error);
// TODO(https://crbug.com/757633): Check that ssl_info.has_value() if
// net_error is a certificate error.
TRACE_EVENT_ASYNC_STEP_INTO1("navigation", "NavigationRequest", this,
......
Tests that navigation request resulting in HTTP 204 is reported as failed.
responseReceived: http://127.0.0.1:8000/inspector-protocol/page/resources/http204.php 204 No Content
loadingFailed: canceled = true
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank(
`Tests that navigation request resulting in HTTP 204 is reported as failed.`);
dp.Network.enable();
dp.Page.enable();
dp.Network.onResponseReceived(event => {
const response = event.params.response;
testRunner.log(`responseReceived: ${response.url} ${response.status} ${response.statusText}`);
});
dp.Network.onLoadingFailed(event => {
const params = event.params;
testRunner.log(`loadingFailed: canceled = ${params.canceled}`);
testRunner.completeTest();
});
page.navigate('http://127.0.0.1:8000/inspector-protocol/page/resources/http204.php');
})
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment