Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upResourceTiming Issue 138: initiatorType test cases #9986
Conversation
w3c-bots
commented
Mar 13, 2018
•
Build PASSEDStarted: 2018-03-16 01:31:46 View more information about this build on: |
|
LGTM % nits about picture and srcset not testing the fallback image. |
| </svg> | ||
| <picture> | ||
| <source srcset="blue.png?id=picture-source" type="image/png" /> | ||
| <img src="blue.png?id=picture-img" /> |
This comment has been minimized.
This comment has been minimized.
yoavweiss
Mar 13, 2018
Contributor
picture-img won't normally download here, so that part of the test won't actually run anywhere other than legacy browsers. Might be worth while to add another test case where the source's media attribute doesn't match.
This comment has been minimized.
This comment has been minimized.
| <img src="blue.png?id=picture-img" /> | ||
| </picture> | ||
| <picture> | ||
| <img src="blue.png?id=picture-img-src" |
This comment has been minimized.
This comment has been minimized.
yoavweiss
Mar 13, 2018
Contributor
picture-img-src won't normally download here, so that part of the test won't actually run anywhere other than legacy browsers. Might be worth while to add another test case where the srcset descriptors don't match the env (e.g. a 16x descriptor), to make sure the implicit 1x resource, represented in src, is downloaded and tested.
This comment has been minimized.
This comment has been minimized.
Makes sense we don't need to test those.
This is not testable because the media elements don't expose a way to trigger those range requests, right? If so, that means it's not a WPT issue, but (potentially) a media element issue. At the same time, I don't know if we should expose web APIs that are only important for testing.
That seems out of scope to me. |
2e8da45
into
web-platform-tests:master
| addEntryIfExists(entries, expected_entries, pathname + 'blue.png?id=video-poster', 'video'); | ||
| addEntryIfExists(entries, expected_entries, '/media/test.mp4?id=video-src', 'video'); | ||
| addEntryIfExists(entries, expected_entries, '/media/test.mp4?id=video-source', 'source'); | ||
| addEntryIfExists(entries, expected_entries, '/media/test.ogg?id=video-source', 'source'); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
web-platform-tests/wpt#9986 has introduced some flakiness to the test that is currently blocking WPT imports. TBR=lukebjerring Bug: 822757 Change-Id: Iddc3adf65989506b72fba003a2bbbd8d9cbf062f No-Try: True Reviewed-on: https://chromium-review.googlesource.com/966604 Reviewed-by: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Cr-Commit-Position: refs/heads/master@{#543724}



nicjansma commentedMar 13, 2018
•
edited by wpt-pr-bot
Addresses w3c/resource-timing#138
This PR adds test cases for ResourceTiming for all known download initiators to validate their
initiatorType.The test case
resource_initiator_types.htmlhas been updated with the following:<img src="...">: Already existed:img<img srcset="...">: Added:img<link rel="stylesheet" href="...">: Already existed:link<link rel="prefetch" href="...">: Added:link<link rel="preload" href="...">: Added:link<link rel="prerender" href="...">: Added:link<link rel="manfiest" href="...">: Added:link<script src="...">: Already existed:script@font-face { src: url(...) }: Already existed:cssbackground: url(...): Already existed:css@import url(...): Already existed:csscursor: url(...): Added:csslist-style-image: url(...): Already existed:css<body background=''>: Already existed:body<input src=''>: Already existed:inputXMLHttpRequest.open(...): Already existed:xmlhttprequest<iframe src="...">: Already existed:iframe<frame src="...">: Already existed inresource_frame_initiator_type.html, merged intoresource_initiator_types.htmlso everything is in one place:frame<object>: Already existed:object<svg><image xlink:href="...">: Added:imagenavigator.sendBeacon(...): Added:beaconfetch(...): Added:fetch<video src="...">: Added:video<video poster="...">: Already existed:video<video><source src="..."></video>: Added:source<audio src="...">: Addedaudio<audio><source src="..."></audio>: Addedsource<picture><source srcset="..."></picture>: Addedsource<picture><img src="..."></picture>: Addedimg<picture><img srcsec="..."></picture>: Addedimg<track src="...">: Addedtrack<embed src="...">: Already existed:embedfavicon.ico: Addedlink(though browsers don't seem to load this when in an IFRAME)eventsource(?)The test was also updated to only validate that when a URL was fetched, that it has the proper
initiatorType. In other words, for things like<link rel="prerender">, if it didn't happen (due to lack of browser support), the test will ignore thatinitiatorTypecheck.From w3c/resource-timing#132, here are the tests I didn't add:
background: url(data:...)(shouldn't be a download)<a ping="...">(too late, happens on navigate away, unlikely anyone would try to capture this via ResourceTiming)<video src="...">withRange:requests (couldn't find a way to force this)<audio src="...">withRange:requests (couldn't find a way to force this)