-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[resource-timing] Report performance entries with failing status codes
Currently we don't report performance entries with failing status codes. From the spec's perspective, reporting aborts is a MAY, but failing status code responses should not be considered aborts. [1] Chromium is the only engine which doesn't report those entries. This CL fixes that to report them similarly to successful status codes. Bug: 883400, 990849 Change-Id: Ic5e99e3df77f3869aa0dd70f0141d88016fdb972 [1] w3c/resource-timing#165 (comment) Change-Id: Ic5e99e3df77f3869aa0dd70f0141d88016fdb972 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796544 Commit-Queue: Yoav Weiss <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Reviewed-by: Mike West <[email protected]> Cr-Commit-Position: refs/heads/master@{#695596}
- Loading branch information
1 parent
e6701a4
commit 807956f
Showing
4 changed files
with
26 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def main(request, response): | ||
status = request.GET.first('status') | ||
response.status = (status, ""); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
</head> | ||
<body> | ||
<img src="resources/status-code.py?status=200"> | ||
<img src="resources/status-code.py?status=307"> | ||
<img src="resources/status-code.py?status=404"> | ||
<img src="resources/status-code.py?status=502"> | ||
<script> | ||
async_test(t => { | ||
window.addEventListener("load", t.step_func(() => { | ||
const images = document.getElementsByTagName("img"); | ||
for (let img of images) { | ||
assert_equals(performance.getEntriesByName(img.src).length, 1, img.src); | ||
} | ||
t.done(); | ||
})); | ||
}, "Make sure all status codes are reported"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters