Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import W3C media-source/dedicated worker WPT
https://bugs.webkit.org/show_bug.cgi?id=269564 rdar://123076441 Reviewed by Eric Carlson. Import WPT media-source/dedicated-worker. Somes changes were required to make all tests pass. 1- When the MediaSource in the worker is being deleted, clean up its SourceBufferLists and notify the HTMLMediaElement about it. The steps added aren't defined in the MSE spec. Issue was raised as w3c/media-source#348 2- TrackBase's creation of the nullLogger wasn't thread-safe and could have been concurrently accessed from both the main and worker thread. 3- Using a MediaSourceHandle already detached or previously attached to a media element must fail 4- The [[has ever been attached]] slot is to be set to true prior changing the delaying the load flag to false media-source/dedicated-worker/mediasource-worker-play.html times out but so does chrome. Will investigate in a follow-up post. Upstream commit: web-platform-tests/wpt@32864fa * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-message-util.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-detach-element-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-detach-element.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-detach-element.js: Added. (onmessage): (catch): (sourceBuffer.onerror): (postMessage): (bufferInto): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-duration-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-duration.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-duration.js: Added. (processPhase): (checkAckVerificationData.messageValuesEqual): (checkAckVerificationData): (bufferMediaAndSendDurationVerificationRequest): (assert): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-get-objecturl.js: Added. (onmessage): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle-transfer-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle-transfer-to-main.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle-transfer.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle-transfer.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-handle.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-must-fail-if-unsupported.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-objecturl-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-objecturl.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-objecturl.js: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play-terminate-worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play-terminate-worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play-terminate-worker.js: Added. (catch): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play.html: Added. * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-play.js: Added. (onmessage): (catch): (sourceBuffer.onerror): (sourceBuffer.onupdateend): (postMessage): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/mediasource-worker-util.js: Added. (MediaSourceWorkerUtil): (MediaSourceWorkerUtil.loadBinaryAsync): * LayoutTests/imported/w3c/web-platform-tests/media-source/dedicated-worker/w3c-import.log: Added. * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/platform/mac/TestExpectations: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::~MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::attachToElement): * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::mediaSourceWasDetached): * Source/WebCore/html/HTMLMediaElement.h: * Source/WebCore/html/track/TrackBase.cpp: (WebCore::nullLogger): (WebCore::TrackBase::TrackBase): Canonical link: https://commits.webkit.org/274959@main
- Loading branch information