Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test exercising media loads where the service worker is rewriting the first request to a different origin #33318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Sep 9, 2024

9913015

Add a test exercising media loads where the service worker is rewriting the first request to a different origin
rdar://135538123
https://bugs.webkit.org/show_bug.cgi?id=279354

Reviewed by NOBODY (OOPS!).

This test is doing the following:
- Register a service worker.
- Create a media element and trigger a cross-origin media load from it.
- The media load starts by fetching the resource first bytes to check whether range requests are supported.
- The service worker intercepts the cross-origin media load and returns a valid synthetic response.
- The media load continues with either of the following:
  - the second fetch is reusing the synthetic response URL and is same origin. In that case, we return an error
  - the second goes to the server and is opaque, and so should fail as per HTML spec.

This test validates that the media load fails as per spec.

* LayoutTests/http/wpt/resources/test.mp4: Added.
* LayoutTests/http/wpt/service-workers/media-range-request-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/media-range-request-worker.js: Added.
(self.onfetch.event.event.request.url.includes):
(self.onfetch.event.videoRequestCount.event.respondWith.new.Response.new.Uint8Array):
* LayoutTests/http/wpt/service-workers/media-range-request.html: Added.

9913015

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 wincairo-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…ng the first request to a different origin

rdar://135538123
https://bugs.webkit.org/show_bug.cgi?id=279354

Reviewed by NOBODY (OOPS!).

This test is doing the following:
- Register a service worker.
- Create a media element and trigger a cross-origin media load from it.
- The media load starts by fetching the resource first bytes to check whether range requests are supported.
- The service worker intercepts the cross-origin media load and returns a valid synthetic response.
- The media load continues with either of the following:
  - the second fetch is reusing the synthetic response URL and is same origin. In that case, we return an error
  - the second goes to the server and is opaque, and so should fail as per HTML spec.

This test validates that the media load fails as per spec.

* LayoutTests/http/wpt/resources/test.mp4: Added.
* LayoutTests/http/wpt/service-workers/media-range-request-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/media-range-request-worker.js: Added.
(self.onfetch.event.event.request.url.includes):
(self.onfetch.event.videoRequestCount.event.respondWith.new.Response.new.Uint8Array):
* LayoutTests/http/wpt/service-workers/media-range-request.html: Added.
@youennf youennf self-assigned this Sep 9, 2024
@youennf youennf added the Media Bugs related to the HTML 5 Media elements. label Sep 9, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 9, 2024
@youennf youennf removed the merging-blocked Applied to prevent a change from being merged label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Media Bugs related to the HTML 5 Media elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants