forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Partially implement
MediaSource.isTypeSupported()
- Loading branch information
Showing
5 changed files
with
200 additions
and
1 deletion.
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
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
66 changes: 66 additions & 0 deletions
66
Tests/LibWeb/Text/expected/wpt-import/media-source/mediasource-is-type-supported.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,66 @@ | ||
Summary | ||
|
||
Harness status: OK | ||
|
||
Rerun | ||
|
||
Found 55 tests | ||
|
||
28 Pass | ||
27 Fail | ||
Details | ||
Result Test Name MessagePass Test invalid MIME format "video" | ||
Pass Test invalid MIME format "video/" | ||
Fail Test invalid MIME format "video/webm" | ||
Fail Test invalid MIME format "video/webm;" | ||
Fail Test invalid MIME format "video/webm;codecs" | ||
Fail Test invalid MIME format "video/webm;codecs=" | ||
Fail Test invalid MIME format "video/webm;codecs="" | ||
Fail Test invalid MIME format "video/webm;codecs=""" | ||
Fail Test invalid MIME format "video/webm;codecs=","" | ||
Fail Test invalid MIME format "audio/webm;aaacodecsbbb=opus" | ||
Pass Test invalid MIME format "unsupported_mediatype" | ||
Pass Test invalid MIME format "" | ||
Pass Test invalid MIME format "null" | ||
Pass Test invalid MSE MIME media type "xxx" | ||
Fail Test invalid MSE MIME media type "text/html" | ||
Fail Test invalid MSE MIME media type "image/jpeg" | ||
Fail Test invalid mismatch between MIME type and codec ID "audio/webm;codecs="vp8"" | ||
Fail Test invalid mismatch between MIME type and codec ID "audio/mp4;codecs="avc1.4d001e"" | ||
Fail Test invalid mismatch between MIME type and codec ID "audio/mp4;codecs="vorbis"" | ||
Fail Test invalid mismatch between MIME type and codec ID "audio/webm;codecs="mp4a.40.2"" | ||
Fail Test invalid mismatch between MIME type and codec ID "video/mp4;codecs="vp8"" | ||
Fail Test invalid mismatch between MIME type and codec ID "video/mp4;codecs="vorbis"" | ||
Fail Test invalid mismatch between MIME type and codec ID "video/webm;codecs="mp4a.40.2"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/mpeg;codecs="mp3"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/mpeg;codecs="mp4a.69"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/mpeg;codecs="mp4a.6B"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/aac;codecs="aac"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/aac;codecs="adts"" | ||
Fail Test invalid inclusion of codecs parameter for mpeg audio types "audio/aac;codecs="mp4a.40"" | ||
Fail Test invalid codec ID "audio/mp4;codecs="mp4a"" | ||
Fail Test invalid codec ID "audio/mp4;codecs="mp4a.40"" | ||
Fail Test invalid codec ID "audio/mp4;codecs="mp4a.40."" | ||
Fail Test invalid codec ID "audio/mp4;codecs="mp4a.67.3"" | ||
Pass Test valid WebM type "video/webm;codecs="vp8"" | ||
Pass Test valid WebM type "video/webm;codecs="vorbis"" | ||
Pass Test valid WebM type "video/webm;codecs="vp8,vorbis"" | ||
Pass Test valid WebM type "video/webm;codecs="vorbis, vp8"" | ||
Pass Test valid WebM type "audio/webm;codecs="vorbis"" | ||
Pass Test valid WebM type "AUDIO/WEBM;CODECS="vorbis"" | ||
Pass Test valid WebM type "audio/webm;codecs=vorbis;test="6"" | ||
Pass Test valid WebM type "audio/webm;codecs="opus"" | ||
Pass Test valid WebM type "video/webm;codecs="opus"" | ||
Pass Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" | ||
Pass Test valid MP4 type "video/mp4;codecs="avc1.42001e"" | ||
Pass Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" | ||
Pass Test valid MP4 type "audio/mp4;codecs="mp4a.40.5"" | ||
Pass Test valid MP4 type "audio/mp4;codecs="mp4a.67"" | ||
Pass Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" | ||
Pass Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" | ||
Pass Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" | ||
Pass Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" | ||
Pass Test valid MP4 type "audio/mp4;codecs="Opus"" | ||
Pass Test valid MP4 type "video/mp4;codecs="Opus"" | ||
Pass Test valid MP4 type "audio/mp4;codecs="fLaC"" | ||
Pass Test valid MP4 type "video/mp4;codecs="fLaC"" |
106 changes: 106 additions & 0 deletions
106
Tests/LibWeb/Text/input/wpt-import/media-source/mediasource-is-type-supported.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<!DOCTYPE html> | ||
<!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> | ||
<html> | ||
<head> | ||
<title>MediaSource.isTypeSupported() test cases.</title> | ||
<script src="../resources/testharness.js"></script> | ||
<script src="../resources/testharnessreport.js"></script> | ||
</head> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
// Generate a distinct test for each type in types | ||
function test_type_support(types, expectation, description) | ||
{ | ||
for (var i = 0; i < types.length; ++i) { | ||
test(function() | ||
{ | ||
assert_equals(MediaSource.isTypeSupported(types[i]), | ||
expectation, 'supported'); | ||
}, description + ' "' + types[i] + '"'); | ||
} | ||
}; | ||
|
||
test_type_support([ | ||
'video', | ||
'video/', | ||
'video/webm', | ||
'video/webm;', | ||
'video/webm;codecs', | ||
'video/webm;codecs=', | ||
'video/webm;codecs="', | ||
'video/webm;codecs=""', | ||
'video/webm;codecs=","', | ||
'audio/webm;aaacodecsbbb=opus', | ||
'unsupported_mediatype', | ||
'', | ||
null | ||
], false, 'Test invalid MIME format'); | ||
|
||
test_type_support([ | ||
'xxx', | ||
'text/html', | ||
'image/jpeg' | ||
], false, 'Test invalid MSE MIME media type'); | ||
|
||
test_type_support([ | ||
'audio/webm;codecs="vp8"', | ||
'audio/mp4;codecs="avc1.4d001e"', | ||
'audio/mp4;codecs="vorbis"', | ||
'audio/webm;codecs="mp4a.40.2"', | ||
'video/mp4;codecs="vp8"', | ||
'video/mp4;codecs="vorbis"', | ||
'video/webm;codecs="mp4a.40.2"', | ||
], false, 'Test invalid mismatch between MIME type and codec ID'); | ||
|
||
// Note that, though the user agent might support some subset of | ||
// these for progressive non-MSE playback, the MSE mpeg audio | ||
// bytestream format specification requires there to be no codecs | ||
// parameter. | ||
test_type_support([ | ||
'audio/mpeg;codecs="mp3"', | ||
'audio/mpeg;codecs="mp4a.69"', | ||
'audio/mpeg;codecs="mp4a.6B"', | ||
'audio/aac;codecs="aac"', | ||
'audio/aac;codecs="adts"', | ||
'audio/aac;codecs="mp4a.40"', | ||
], false, 'Test invalid inclusion of codecs parameter for mpeg audio types'); | ||
|
||
test_type_support([ | ||
'audio/mp4;codecs="mp4a"', | ||
'audio/mp4;codecs="mp4a.40"', | ||
'audio/mp4;codecs="mp4a.40."', | ||
'audio/mp4;codecs="mp4a.67.3"' | ||
], false, 'Test invalid codec ID'); | ||
|
||
test_type_support([ | ||
'video/webm;codecs="vp8"', | ||
'video/webm;codecs="vorbis"', | ||
'video/webm;codecs="vp8,vorbis"', | ||
'video/webm;codecs="vorbis, vp8"', | ||
'audio/webm;codecs="vorbis"', | ||
'AUDIO/WEBM;CODECS="vorbis"', | ||
'audio/webm;codecs=vorbis;test="6"', | ||
'audio/webm;codecs="opus"', | ||
'video/webm;codecs="opus"' | ||
], true, 'Test valid WebM type'); | ||
|
||
test_type_support([ | ||
'video/mp4;codecs="avc1.4d001e"', // H.264 Main Profile level 3.0 | ||
'video/mp4;codecs="avc1.42001e"', // H.264 Baseline Profile level 3.0 | ||
'audio/mp4;codecs="mp4a.40.2"', // MPEG4 AAC-LC | ||
'audio/mp4;codecs="mp4a.40.5"', // MPEG4 HE-AAC | ||
'audio/mp4;codecs="mp4a.67"', // MPEG2 AAC-LC | ||
'video/mp4;codecs="mp4a.40.2"', | ||
'video/mp4;codecs="avc1.4d001e,mp4a.40.2"', | ||
'video/mp4;codecs="mp4a.40.2 , avc1.4d001e "', | ||
'video/mp4;codecs="avc1.4d001e,mp4a.40.5"', | ||
'audio/mp4;codecs="Opus"', | ||
'video/mp4;codecs="Opus"', | ||
'audio/mp4;codecs="fLaC"', | ||
'video/mp4;codecs="fLaC"' | ||
], true, 'Test valid MP4 type'); | ||
|
||
</script> | ||
</body> | ||
</html> |