Bug
1735923 - avoid caching effects with a different query parameter for each subtest r=padenot
to work around https://bugzilla.mozilla.org/show_bug.cgi?id=
1129121
[range responses from multiple origins (cross-origin first)] expects [1] the
browser to ignore the URL of the response to the first request, which was
redirected by the ServiceWorker, and to fetch the rest of the resource from
the original URL.
With Gecko on Android, where browser.opaqueResponseBlocking is false [2],
the response from the ServiceWorker is interpreted [3] as a redirect, and
the rest of the resource is fetched from the cross-origin URL of the
response. Gecko does not support drawImage() with video elements on
Android [4], the video is not drawn, and the test generates NOT_TAINTED [5]
instead of the expected LOAD_ERROR.
With Gecko on other platforms, browser.opaqueResponseBlocking is true. The
"the audio or video type pattern matching algorithm given bytes" returns
undefined because the first response is short and so the
opaque-response-safelist check [6] returns false because "essence starts
with" "video/". The video errors out and the test passes with LOAD_ERROR.
[range responses from single origin with both opaque and non-opaque responses]
expects [7] the browser to pass two requests through the ServiceWorker.
Gecko on Android interprets the first cross-origin response as a redirect.
Gecko does not [8] pass no_cors cross-origin range requests to the
ServiceWorker, but fetches the rest of the resource directly from the
cross-origin URL of the response, bypassing the ServiceWorker. The video is
not drawn, and the test generates NOT_TAINTED instead of the expected
TAINTED.
With browser.opaqueResponseBlocking true on other platforms in Gecko, the
opaque-response-safelist check [6] for the opaque first response returns
false, and so the test generates LOAD_ERROR instead of the expected TAINTED.
[1]
https://github.com/web-platform-tests/wpt/blob/
b47f513104d4332e4c639cf74e04475f2a1c9196/service-workers/service-worker/resources/range-request-to-different-origins-worker.js#L4-L6
[2]
https://searchfox.org/mozilla-central/rev/
9a5bf21ea2dd04946734658f67f83f62ca76b0fa/modules/libpref/init/StaticPrefList.yaml#1714-1715
[3]
https://searchfox.org/mozilla-central/rev/
c130c69b7b863d5e28ab9524b65c27c7a9507c48/dom/media/BaseMediaResource.cpp#33,37
[4]
https://bugzilla.mozilla.org/show_bug.cgi?id=
1526207
[5]
https://bugzilla.mozilla.org/show_bug.cgi?id=
1876601
[6]
https://whatpr.org/fetch/1442.html#opaque-response-safelist-check
[7]
https://github.com/web-platform-tests/wpt/blob/
b47f513104d4332e4c639cf74e04475f2a1c9196/service-workers/service-worker/resources/range-request-with-different-cors-modes-worker.js#L4-L6
[8]
https://hg.mozilla.org/mozilla-central/rev/
47a7f8cc0821
Differential Revision: https://phabricator.services.mozilla.com/
D143866