mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
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:
@@ -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>) {
|
||||
|
||||
Reference in New Issue
Block a user