Bug 1735923 test mixing of synthesized and network fallback range responses r=edenchuang
commit8c40462e7bb9f91d5f8e9f3ff6d727267fe575dc
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 26 Jan 2024 20:38:50 +0000 (26 20:38 +0000)
committerKarl Tomlinson <karlt+@karlt.net>
Fri, 26 Jan 2024 20:38:50 +0000 (26 20:38 +0000)
tree89562fdae19b939f018b30a962641237c8bfe896
parent2434015dc58e9c5b805638ee57b0431c406c230b
Bug 1735923 test mixing of synthesized and network fallback range responses r=edenchuang

[synth and cross-origin fallback range responses] expects the browser to pass
cross-origin requests to the ServiceWorker.  Gecko no longer [1] passes
no_cors cross-origin range requests to the ServiceWorker.  The response comes
directly from the server.

  Gecko on Android has browser.opaqueResponseBlocking is false [2] and does
  not support drawImage() with video elements [3].  The video is not drawn,
  and the test generates NOT_TAINTED [4] 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 [5] returns false because "essence starts
  with" "video/".  The video errors out and the test passes with LOAD_ERROR.

[1]
https://hg.mozilla.org/mozilla-central/rev/47a7f8cc0821
[2]
https://searchfox.org/mozilla-central/rev/9a5bf21ea2dd04946734658f67f83f62ca76b0fa/modules/libpref/init/StaticPrefList.yaml#1714-1715
[3]
https://bugzilla.mozilla.org/show_bug.cgi?id=1526207
[4]
https://bugzilla.mozilla.org/show_bug.cgi?id=1876601
[5]
https://whatpr.org/fetch/1442.html#opaque-response-safelist-check

Differential Revision: https://phabricator.services.mozilla.com/D143867
testing/web-platform/meta/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html.ini
testing/web-platform/tests/service-workers/service-worker/fetch-canvas-tainting-video-with-range-request.https.html
testing/web-platform/tests/service-workers/service-worker/resources/range-request-with-synth-head-worker.js [new file with mode: 0644]