Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ManagedMediaExtension missing SkipVTableValidation in IDL
https://bugs.webkit.org/show_bug.cgi?id=252307 rdar://105489108 Reviewed by Cameron McCormack. ManagedMediaSource and ManagedSourceBuffer inherit from MediaSource and SourceBuffer respectively. As such, both MediaSource and SourceBuffer need SkipVTableValidation keyword in their IDL definition to avoid `RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);` Added some minimal tests working on all platforms. * LayoutTests/platform/glib/TestExpectations: Skip test for now (see bug 252386) * LayoutTests/media/media-source/content/test-vorbis-manifest.json: Fix duration. * LayoutTests/media/media-source/content/test-xhe-aac-manifest.json: Fix duration. * LayoutTests/media/media-source/media-managedmse-expected.txt: Added. * LayoutTests/media/media-source/media-managedmse.html: Added. * LayoutTests/media/media-source/media-source-loader.js: (MediaSourceLoader.prototype.mediaSegmentEndTime): Add method. * Source/WebCore/Modules/mediasource/MediaSource.idl: * Source/WebCore/Modules/mediasource/SourceBuffer.idl: Canonical link: https://commits.webkit.org/260360@main
- Loading branch information
Showing
8 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
LayoutTests/media/media-source/media-managedmse-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
RUN(video.src = URL.createObjectURL(source)) | ||
EVENT(sourceopen) | ||
RUN(sourceBuffer = source.addSourceBuffer(loader.type())) | ||
RUN(sourceBuffer.appendBuffer(loader.initSegment())) | ||
EVENT(update) | ||
Append a media segment. | ||
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0))) | ||
EVENT(update) | ||
EXPECTED (sourceBuffer.buffered.length == '1') OK | ||
EXPECTED (sourceBuffer.buffered.end(0).toFixed(4) == loader.mediaSegmentEndTime(0) == 'true') OK | ||
Clean sourcebuffer of all content. | ||
RUN(sourceBuffer.remove(0, 100)) | ||
EVENT(update) | ||
EXPECTED (sourceBuffer.buffered.length == '0') OK | ||
END OF TEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ ManagedMediaSourceEnabled=true MediaSourceEnabled=true ] --> | ||
<html> | ||
<head> | ||
<title>managedmediasource</title> | ||
<script src="../../media/media-source/media-source-loader.js"></script> | ||
<script src="../../media/video-test.js"></script> | ||
<script> | ||
var loader; | ||
var source; | ||
var sourceBuffer; | ||
|
||
function loaderPromise(loader) { | ||
return new Promise((resolve, reject) => { | ||
loader.onload = resolve; | ||
loader.onerror = reject; | ||
}); | ||
} | ||
|
||
window.addEventListener('load', async event => { | ||
try { | ||
findMediaElement(); | ||
|
||
let manifests = [ 'content/test-opus-manifest.json', 'content/test-vorbis-manifest.json', 'content/test-48kHz-manifest.json', 'content/test-xhe-aac-manifest.json' ]; | ||
for (const manifest of manifests) { | ||
loader = new MediaSourceLoader(manifest); | ||
await loaderPromise(loader); | ||
if (ManagedMediaSource.isTypeSupported(loader.type())) | ||
break; | ||
} | ||
|
||
source = new ManagedMediaSource(); | ||
run('video.src = URL.createObjectURL(source)'); | ||
await waitFor(source, 'sourceopen'); | ||
waitFor(video, 'error').then(failTest); | ||
|
||
run('sourceBuffer = source.addSourceBuffer(loader.type())'); | ||
run('sourceBuffer.appendBuffer(loader.initSegment())'); | ||
await waitFor(sourceBuffer, 'update'); | ||
|
||
consoleWrite('Append a media segment.') | ||
run('sourceBuffer.appendBuffer(loader.mediaSegment(0))'); | ||
await waitFor(sourceBuffer, 'update'); | ||
testExpected('sourceBuffer.buffered.length', '1'); | ||
testExpected('sourceBuffer.buffered.end(0).toFixed(4) == loader.mediaSegmentEndTime(0)', true); | ||
|
||
consoleWrite('Clean sourcebuffer of all content.'); | ||
run('sourceBuffer.remove(0, 100)'); | ||
await waitFor(sourceBuffer, 'update'); | ||
testExpected('sourceBuffer.buffered.length', '0'); | ||
|
||
endTest(); | ||
} catch (e) { | ||
failTest(`Caught exception: "${e}"`); | ||
} | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<video controls></video> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters