Skip to content

Commit

Permalink
Bug 1580408 [wpt PR 18987] - [resource-timing] Report performance ent…
Browse files Browse the repository at this point in the history
…ries with failing status codes, a=testonly

Automatic update from web-platform-tests
[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}

--

wpt-commits: 807956fd31824995580dcf36661520452083f9ef
wpt-pr: 18987
  • Loading branch information
Yoav Weiss authored and moz-wptsync-bot committed Sep 14, 2019
1 parent c011845 commit e226493
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 35 deletions.

This file was deleted.

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, "");

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>
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@
resource: 'resources/missing.jpg',
mode: 'same-origin',
description: 'Network fallback load failure',
should_no_performance_entry: true,
});
verify({
performance: performance,
resource: 'resources/missing.jpg',
mode: 'cross-origin',
description: 'Network fallback cross-origin load failure',
should_no_performance_entry: true,
});
// Tests for respondWith(fetch()).
verify({
Expand Down

0 comments on commit e226493

Please sign in to comment.