Closed Bug 1777348 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 34651 - MSE-in-Workers: Switch MediaSourceHandle to be Transferable-only

Categories

(Core :: Audio/Video: Playback, task, P4)

task

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Matt Wolenetz <wolenetz@chromium.org> wrote:

MSE-in-Workers: Switch MediaSourceHandle to be Transferable-only

Updates serialization logic to reflect current state of discussion of
MediaSourceHandle refinement in spec [1]:

  • MediaSourceHandle was previously Serializable-only. With this change,
    it is now Transferable-only. Data clone exception will occur if it is
    attempted to be serialized without transfer. Data clone exception
    will also occur if it is transferred more than once in same
    postMessage, or if it has already been transferred.

  • Updates MediaSourceHandleImpl to use "[[Detached]]" internal slot
    semantic to know when a handle instance has already been transferred.
    This is necessary, beyond just knowing if it has been serialized,
    because otherwise the following scenario could not be enforced:
    postMessage(null, [handle]); // Should succeed and detach handle.
    // Then, this should fail because handle is already detached:
    postMessage(handle, [handle]);

  • Manual tests verified the scenario for the following matches similar
    existing behavior for MessagePort transfer:
    postMessage( {x: handle, y: handle}, [handle]); // should succeed
    // on receipt: e.data.x === e.data.y should be true.

Existing handle-based MSE-in-Worker web-platform-tests are updated to
use transfer instead of just serialization to communicate the handles.
Later changes may add greater coverage, similar to coverage developed
locally while vetting this scenario and precedents like MessagePort
transfer.

Later change(s) may update the IDL and getHandle() implementation
according to similar spec discussion that has requested consideration
of using: [SameObject] handle() instead of current at-most-once
getHandle() success.

No change is made to the [[has_ever_been_used_as_srcObject]] logic: it
is still necessary to prevent transferring-away of a handle instance
once it has been assigned to the srcObject attribute of a media element.

[1] https://github.com/w3c/media-source/pull/306#issuecomment-1169155637

BUG=878133,1338956

Change-Id: Icb64aa712a0ce310984ca5fa0e9e02bd9ac428b8

Reviewed-on: https://chromium-review.googlesource.com/3733664
WPT-Export-Revision: 4f6d3934ea750574b940ed3b93a9fc0653660063

Component: web-platform-tests → Audio/Video: Playback
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 4 tests and 1 subtests

Status Summary

Firefox

OK : 4
PASS : 1
FAIL : 18

Chrome

OK : 2
PASS : 5
FAIL : 17
TIMEOUT: 1
ERROR : 2

Safari

OK : 4
PASS : 1
FAIL : 18

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /media-source/dedicated-worker/mediasource-worker-detach-element.html [wpt.fyi]
    • Test element detachment from worker MediaSource after at least 0 main thread setTimeouts, starting counting after setting srcObject: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 1 main thread setTimeouts, starting counting after setting srcObject: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 2 main thread setTimeouts, starting counting after setting srcObject: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 3 main thread setTimeouts, starting counting after setting srcObject: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 4 main thread setTimeouts, starting counting after setting srcObject: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 0 main thread setTimeouts, starting counting after receiving Started Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 1 main thread setTimeouts, starting counting after receiving Started Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 2 main thread setTimeouts, starting counting after receiving Started Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 3 main thread setTimeouts, starting counting after receiving Started Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 4 main thread setTimeouts, starting counting after receiving Started Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 0 main thread setTimeouts, starting counting after receiving Finished Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 1 main thread setTimeouts, starting counting after receiving Finished Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 2 main thread setTimeouts, starting counting after receiving Finished Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 3 main thread setTimeouts, starting counting after receiving Finished Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
    • Test element detachment from worker MediaSource after at least 4 main thread setTimeouts, starting counting after receiving Finished Buffering message from worker: FAIL (Chrome: FAIL, Safari: FAIL)
  • /media-source/dedicated-worker/mediasource-worker-duration.html [wpt.fyi]
    • Test worker MediaSource duration updates before and after HAVE_METADATA: FAIL (Chrome: FAIL, Safari: FAIL)
  • /media-source/dedicated-worker/mediasource-worker-handle.html [wpt.fyi]
    • Test main context receipt of postMessage'd MediaSourceHandle from DedicatedWorker MediaSource: FAIL (Chrome: TIMEOUT, Safari: FAIL)
  • /media-source/dedicated-worker/mediasource-worker-play.html [wpt.fyi]
    • Test worker MediaSource construction, attachment, buffering and basic playback: FAIL (Chrome: FAIL, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5bd4c978b186 [wpt PR 34651] - MSE-in-Workers: Switch MediaSourceHandle to be Transferable-only, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.