Closed Bug 1445109 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 9986 - ResourceTiming Issue 138: initiatorType test cases

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: mozilla.org, Unassigned)

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 9986 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/w3c/web-platform-tests/pull/9986
Details from upstream follow.

Nic Jansma wrote:
>  ResourceTiming Issue 138: initiatorType test cases
>  
>  Addresses https://github.com/w3c/resource-timing/issues/138
>  
>  This PR adds test cases for ResourceTiming for all [known download initiators](https://github.com/w3c/resource-timing/issues/132) to validate their `initiatorType`.
>  
>  The test case `resource_initiator_types.html` has 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`
>  * CSS `@font-face { src: url(...) }`: Already existed: `css`
>  * CSS `background: url(...)`: Already existed: `css`
>  * CSS `@import url(...)`: Already existed: `css`
>  * CSS `cursor: url(...)`: Added: `css`
>  * CSS `list-style-image: url(...)`: Already existed: `css`
>  * `<body background=''>`: Already existed: `body`
>  * `<input src=''>`: Already existed: `input`
>  * `XMLHttpRequest.open(...)`: Already existed: `xmlhttprequest`
>  * `<iframe src="...">`: Already existed: `iframe`
>  * `<frame src="...">`: Already existed in `resource_frame_initiator_type.html`, merged into `resource_initiator_types.html` so everything is in one place: `frame`
>  * `<object>`: Already existed: `object`
>  * `<svg><image xlink:href="...">`: Added: `image`
>  * `navigator.sendBeacon(...)`: Added: `beacon`
>  * `fetch(...)`: Added: `fetch`
>  * `<video src="...">`: Added: `video`
>  * `<video poster="...">`: Already existed: `video`
>  * `<video><source src="..."></video>`: Added: `source`
>  * `<audio src="...">`: Added `audio`
>  * `<audio><source src="..."></audio>`: Added `source`
>  * `<picture><source srcset="..."></picture>`: Added `source`
>  * `<picture><img src="..."></picture>`: Added `img`
>  * `<picture><img srcsec="..."></picture>`: Added `img`
>  * `<track src="...">`: Added `track`
>  * `<embed src="...">`: Already existed: `embed`
>  * `favicon.ico`: Added `link` (though browsers don't seem to load this when in an IFRAME)
>  * EventSource: Added `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 that `initiatorType` check.
>  
>  From https://github.com/w3c/resource-timing/issues/132, here are the tests I didn't add:
>  
>  * CSS `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="...">` with `Range:` requests (couldn't find a way to force this)
>  * `<audio src="...">` with `Range:` requests (couldn't find a way to force this)
>  * UA extensions
>
Component: web-platform-tests → DOM
Product: Testing → Core
Ran 1 tests and 34 subtests
OK     : 1
PASS   : 18
FAIL   : 16

New tests that have failures or other problems:
/resource-timing/resource_initiator_types.html
    http://web-platform.test:8000/media/test.mp4?id=video-source is expected to have initiatorType source: FAIL
    http://web-platform.test:8000/media/test.mp4?id=video-src is expected to have initiatorType video: FAIL
    http://web-platform.test:8000/resource-timing/resources/blue.png?id=picture-source is expected to have initiatorType source: FAIL
    http://web-platform.test:8000/resource-timing/resources/blue.png?id=video-poster is expected to have initiatorType video: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=audio-source-mpeg is expected to have initiatorType source: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=audio-source-ogg is expected to have initiatorType source: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=audio-source-wav is expected to have initiatorType source: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=audio-src is expected to have initiatorType audio: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=beacon is expected to have initiatorType beacon: FAIL
    http://web-platform.test:8000/resource-timing/resources/empty.py?id=video-track is expected to have initiatorType track: FAIL
    http://web-platform.test:8000/resource-timing/resources/eventsource.py?id=eventsource is expected to have initiatorType eventsource: FAIL
    http://web-platform.test:8000/resource-timing/resources/nested.css?id=prefetch is expected to have initiatorType link: FAIL
    http://web-platform.test:8000/resource-timing/resources/nested.css?id=preload is expected to have initiatorType link: FAIL
P4 is unused to setting priority to P3.
Priority: P4 → P3
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a9434efe00ee
[wpt PR 9986] - ResourceTiming Issue 138: initiatorType test cases, a=testonly
https://hg.mozilla.org/mozilla-central/rev/a9434efe00ee
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.