- Revision
- 250167
- Author
- commit-qu...@webkit.org
- Date
- 2019-09-20 16:59:02 -0700 (Fri, 20 Sep 2019)
Log Message
[resource-timing] Report performance entries with all HTTP status codes
https://bugs.webkit.org/show_bug.cgi?id=202040
Patch by Alex Christensen <achristen...@webkit.org> on 2019-09-20
Reviewed by Joseph Pecoraro.
LayoutTests/imported/w3c:
* web-platform-tests/resource-timing/resource_ignore_failures-expected.txt: Removed.
* web-platform-tests/resource-timing/resource_ignore_failures.html: Removed.
This test is no longer in wpt and it would regress with this change, so we remove it.
* web-platform-tests/resource-timing/resources/status-code.py: Added.
(main):
* web-platform-tests/resource-timing/status-codes-create-entry-expected.txt: Added.
* web-platform-tests/resource-timing/status-codes-create-entry.html: Added.
Source/WebCore:
This follows a Chromium change at https://chromium-review.googlesource.com/c/chromium/src/+/1796544
The spec change is being discussed at https://github.com/w3c/resource-timing/issues/165
Test: imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html
I had to slightly modify the test to make sure the entry count was > 0 instead of == 1 to reduce flakyness because sometimes we load the 200 image twice.
I'll submit a PR to WPT, too.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (250166 => 250167)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-09-20 23:54:51 UTC (rev 250166)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-09-20 23:59:02 UTC (rev 250167)
@@ -1,3 +1,18 @@
+2019-09-20 Alex Christensen <achristen...@webkit.org>
+
+ [resource-timing] Report performance entries with all HTTP status codes
+ https://bugs.webkit.org/show_bug.cgi?id=202040
+
+ Reviewed by Joseph Pecoraro.
+
+ * web-platform-tests/resource-timing/resource_ignore_failures-expected.txt: Removed.
+ * web-platform-tests/resource-timing/resource_ignore_failures.html: Removed.
+ This test is no longer in wpt and it would regress with this change, so we remove it.
+ * web-platform-tests/resource-timing/resources/status-code.py: Added.
+ (main):
+ * web-platform-tests/resource-timing/status-codes-create-entry-expected.txt: Added.
+ * web-platform-tests/resource-timing/status-codes-create-entry.html: Added.
+
2019-09-20 Rob Buis <rb...@igalia.com>
Synchronize MathML WPT tests against upstream
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures-expected.txt (250166 => 250167)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures-expected.txt 2019-09-20 23:54:51 UTC (rev 250166)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures-expected.txt 2019-09-20 23:59:02 UTC (rev 250167)
@@ -1,7 +0,0 @@
-Description
-
-This test validates that failed resources aren't present in the Resource Timing buffer.
-
-
-PASS entries.length == 0
-
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures.html (250166 => 250167)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures.html 2019-09-20 23:54:51 UTC (rev 250166)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_ignore_failures.html 2019-09-20 23:59:02 UTC (rev 250167)
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8" />
-<title>Resource Timing ignores failed resources</title>
-<link rel="author" title="Google" href="" />
-<link rel="help" href=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script>
-let iframe;
-function setup_iframe() {
- const iframe_content = '<img src=""
- iframe = document.getElementById('frameContext');
- iframe.contentWindow.document.write(iframe_content);
-}
-function onload_test() {
- const context = new PerformanceContext(iframe.contentWindow.performance);
- const entries = context.getEntriesByType('resource');
- test_true(entries.length == 0, "entries.length == 0");
-}
-window.setup_iframe = setup_iframe;
-</script>
-</head>
-<body>
-<h1>Description</h1>
-<p>This test validates that failed resources aren't present in the Resource Timing buffer.</p>
-<div id="log"></div>
-<iframe id="frameContext" _onload_="onload_test();" src=""
-</body>
-</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py (0 => 250167)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/status-code.py 2019-09-20 23:59:02 UTC (rev 250167)
@@ -0,0 +1,4 @@
+def main(request, response):
+ status = request.GET.first('status')
+ response.status = (status, "");
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry-expected.txt (0 => 250167)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry-expected.txt 2019-09-20 23:59:02 UTC (rev 250167)
@@ -0,0 +1,4 @@
+
+
+PASS Make sure all status codes are reported
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html (0 => 250167)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html 2019-09-20 23:59:02 UTC (rev 250167)
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<img src=""
+<img src=""
+<img src=""
+<img src=""
+<script>
+async_test(t => {
+ window.addEventListener("load", t.step_func(() => {
+ const images = document.getElementsByTagName("img");
+ for (let img of images) {
+ assert_greater_than(performance.getEntriesByName(img.src).length, 0, img.src);
+ }
+ t.done();
+ }));
+}, "Make sure all status codes are reported");
+</script>
Modified: trunk/Source/WebCore/ChangeLog (250166 => 250167)
--- trunk/Source/WebCore/ChangeLog 2019-09-20 23:54:51 UTC (rev 250166)
+++ trunk/Source/WebCore/ChangeLog 2019-09-20 23:59:02 UTC (rev 250167)
@@ -1,3 +1,21 @@
+2019-09-20 Alex Christensen <achristen...@webkit.org>
+
+ [resource-timing] Report performance entries with all HTTP status codes
+ https://bugs.webkit.org/show_bug.cgi?id=202040
+
+ Reviewed by Joseph Pecoraro.
+
+ This follows a Chromium change at https://chromium-review.googlesource.com/c/chromium/src/+/1796544
+ The spec change is being discussed at https://github.com/w3c/resource-timing/issues/165
+
+ Test: imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html
+
+ I had to slightly modify the test to make sure the entry count was > 0 instead of == 1 to reduce flakyness because sometimes we load the 200 image twice.
+ I'll submit a PR to WPT, too.
+
+ * loader/ResourceTimingInformation.cpp:
+ (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
+
2019-09-20 Keith Rollin <krol...@apple.com>
Remove check of setSourceAppPid selector that's no longer needed
Modified: trunk/Source/WebCore/loader/ResourceTimingInformation.cpp (250166 => 250167)
--- trunk/Source/WebCore/loader/ResourceTimingInformation.cpp 2019-09-20 23:54:51 UTC (rev 250166)
+++ trunk/Source/WebCore/loader/ResourceTimingInformation.cpp 2019-09-20 23:59:02 UTC (rev 250167)
@@ -45,8 +45,6 @@
// <https://github.com/w3c/resource-timing/issues/100>
if (!resource.resourceRequest().url().protocolIsInHTTPFamily())
return false;
- if (resource.response().httpStatusCode() >= 400)
- return false;
if (resource.errorOccurred())
return false;
if (resource.wasCanceled())