mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326
This commit is contained in:
parent
462c272380
commit
1f531f66ea
5377 changed files with 174916 additions and 84369 deletions
|
@ -129,7 +129,7 @@ mediaSource = new MediaSource();
|
|||
video.src = URL.createObjectURL(mediaSource);
|
||||
mediaSource.addEventListener("sourceopen", function () {
|
||||
var defaultType ='video/webm;codecs="vp8,vorbis"';
|
||||
if (video.canPlayType(defaultType)) {
|
||||
if (MediaSource.isTypeSupported(defaultType)) {
|
||||
sourceBuffer = mediaSource.addSourceBuffer(defaultType);
|
||||
} else {
|
||||
sourceBuffer = mediaSource.addSourceBuffer('video/mp4');
|
||||
|
|
|
@ -411,6 +411,58 @@
|
|||
});
|
||||
}, "Test appendBuffer with partial media segments.");
|
||||
|
||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||
{
|
||||
var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
|
||||
var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]);
|
||||
|
||||
assert_equals(mediaElement.readyState, mediaElement.HAVE_NOTHING);
|
||||
assert_equals(mediaSource.duration, Number.NaN);
|
||||
|
||||
// readyState is changing as per the Initialization Segment Received algorithm.
|
||||
var loadedmetadataCalled = false;
|
||||
mediaElement.addEventListener("loadedmetadata", function metadata(e) {
|
||||
loadedmetadataCalled = true;
|
||||
e.target.removeEventListener(e.type, metadata);
|
||||
});
|
||||
sourceBuffer.addEventListener("updateend", function updateend(e) {
|
||||
assert_true(loadedmetadataCalled);
|
||||
assert_equals(mediaElement.readyState, mediaElement.HAVE_METADATA);
|
||||
e.target.removeEventListener(e.type, updateend);
|
||||
});
|
||||
test.expectEvent(sourceBuffer, "updateend", "remainingInitSegment append ended.");
|
||||
test.expectEvent(mediaElement, "loadedmetadata", "loadedmetadata event received.");
|
||||
sourceBuffer.appendBuffer(initSegment);
|
||||
|
||||
test.waitForExpectedEvents(function()
|
||||
{
|
||||
assert_equals(mediaElement.readyState, mediaElement.HAVE_METADATA);
|
||||
assert_equals(mediaSource.duration, segmentInfo.duration);
|
||||
// readyState is changing as per the Coded Frame Processing algorithm.
|
||||
var loadeddataCalled = false;
|
||||
mediaElement.addEventListener("loadeddata", function loadeddata(e) {
|
||||
loadeddataCalled = true;
|
||||
e.target.removeEventListener(e.type, loadeddata);
|
||||
});
|
||||
sourceBuffer.addEventListener("updateend", function updateend(e) {
|
||||
assert_true(loadeddataCalled);
|
||||
assert_greater_than_equal(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA);
|
||||
e.target.removeEventListener(e.type, updateend);
|
||||
});
|
||||
test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended.");
|
||||
test.expectEvent(mediaElement, "loadeddata", "loadeddata fired.");
|
||||
sourceBuffer.appendBuffer(mediaSegment);
|
||||
});
|
||||
|
||||
test.waitForExpectedEvents(function()
|
||||
{
|
||||
assert_greater_than_equal(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA);
|
||||
assert_equals(sourceBuffer.updating, false);
|
||||
assert_equals(mediaSource.readyState, "open");
|
||||
test.done();
|
||||
});
|
||||
}, "Test appendBuffer events order.");
|
||||
|
||||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
|
||||
{
|
||||
var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
|
||||
|
|
|
@ -33,9 +33,12 @@
|
|||
{
|
||||
var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
|
||||
test.expectEvent(mediaElement, 'durationchange', 'mediaElement got duration after initsegment');
|
||||
test.expectEvent(sourceBuffer, 'update');
|
||||
test.expectEvent(sourceBuffer, 'updateend');
|
||||
sourceBuffer.appendBuffer(initSegment);
|
||||
test.waitForExpectedEvents(function()
|
||||
{
|
||||
assert_false(sourceBuffer.updating, "updating attribute is false");
|
||||
test.expectEvent(mediaElement, 'durationchange', 'mediaElement got infinity duration');
|
||||
mediaSource.duration = Infinity;
|
||||
test.waitForExpectedEvents(function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue