script: Some failed requests should record resource timing entries (#41804)

Some failed requests should record resource timing entries

Testing: ./mach test-wpt
tests/wpt/tests/resource-timing/entries-for-network-errors.sub.https.html
Fixes: https://github.com/servo/servo/issues/41667

---------

Signed-off-by: bellau <laurent.belmonte@gmail.com>
This commit is contained in:
Laurent Belmonte
2026-01-14 14:20:12 +01:00
committed by GitHub
parent 77a1a2546c
commit 0dc28296e0
31 changed files with 182 additions and 212 deletions

View File

@@ -375,7 +375,8 @@ impl FetchResponseListener for ClassicContext {
fn process_response_eof(
mut self,
_: RequestId,
response: Result<ResourceFetchTiming, NetworkError>,
response: Result<(), NetworkError>,
timing: ResourceFetchTiming,
) {
match (response.as_ref(), self.status.as_ref()) {
(Err(error), _) | (_, Err(error)) => {
@@ -389,9 +390,7 @@ impl FetchResponseListener for ClassicContext {
);
// Resource timing is expected to be available before "error" or "load" events are fired.
if let Ok(response) = &response {
network_listener::submit_timing(&self, response, CanGc::note());
}
network_listener::submit_timing(&self, &response, &timing, CanGc::note());
return;
},
_ => {},
@@ -472,9 +471,7 @@ impl FetchResponseListener for ClassicContext {
);
// }
if let Ok(response) = response {
network_listener::submit_timing(&self, &response, CanGc::note());
}
network_listener::submit_timing(&self, &response, &timing, CanGc::note());
}
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<Violation>) {