// the LayoutTest timeout. This prevents testharness.js from prematurely
// terminating tests and allows the LayoutTest runner to control when to
// timeout the test.
- // FIXME: Change this to use explicit_timeout instead once /resources/testharness.js
- // is updated to a more recent version.
- setup({ timeout: 120000 });
+ setup({ explicit_timeout: 120000 });
var SEGMENT_INFO_LIST = [
{
url: '/media/resources/media-source/webm/test.webm',
type: 'video/webm; codecs="vp8, vorbis"',
- // FIXME: Get the init segment duration fixed to match duration after append.
- // See http://crbug.com/354284.
durationInInitSegment: 6.042,
- duration: 6.051,
+ duration: 6.042,
// Supports jagged-ended stream end timestamps with some less than duration:
bufferedRangeEndBeforeEndOfStream: 6.040,
init: { offset: 0, size: 4357 },
media: [
- { offset: 4357, size: 11830, timecode: 0 },
- { offset: 16187, size: 12588, timecode: 0.385 },
- { offset: 28775, size: 14588, timecode: 0.779 },
- { offset: 43363, size: 13023, timecode: 1.174 },
- { offset: 56386, size: 13127, timecode: 1.592 },
- { offset: 69513, size: 14456, timecode: 1.987 },
- { offset: 83969, size: 13458, timecode: 2.381 },
- { offset: 97427, size: 14566, timecode: 2.776 },
- { offset: 111993, size: 13201, timecode: 3.171 },
- { offset: 125194, size: 14061, timecode: 3.566 },
- { offset: 139255, size: 15353, timecode: 3.96 },
- { offset: 154608, size: 13618, timecode: 4.378 },
- { offset: 168226, size: 15094, timecode: 4.773 },
- { offset: 183320, size: 13069, timecode: 5.168 },
- { offset: 196389, size: 13788, timecode: 5.563 },
- { offset: 210177, size: 9009, timecode: 5.957 },
+ { offset: 4357, size: 11830, timecode: 0, highest_end_time: 0.398 },
+ { offset: 16187, size: 12588, timecode: 0.385, highest_end_time: 0.797 },
+ { offset: 28775, size: 14588, timecode: 0.779, highest_end_time: 1.195 },
+ { offset: 43363, size: 13023, timecode: 1.174, highest_end_time: 1.593 },
+ { offset: 56386, size: 13127, timecode: 1.592, highest_end_time: 1.992 },
+ { offset: 69513, size: 14456, timecode: 1.987, highest_end_time: 2.39 },
+ { offset: 83969, size: 13458, timecode: 2.381, highest_end_time: 2.789 },
+ { offset: 97427, size: 14566, timecode: 2.776, highest_end_time: 3.187 },
+ { offset: 111993, size: 13201, timecode: 3.171, highest_end_time: 3.585 },
+ { offset: 125194, size: 14061, timecode: 3.566, highest_end_time: 3.984 },
+ { offset: 139255, size: 15353, timecode: 3.96, highest_end_time: 4.382 },
+ { offset: 154608, size: 13618, timecode: 4.378, highest_end_time: 4.781 },
+ { offset: 168226, size: 15094, timecode: 4.773, highest_end_time: 5.179 },
+ { offset: 183320, size: 13069, timecode: 5.168, highest_end_time: 5.577 },
+ { offset: 196389, size: 13788, timecode: 5.563, highest_end_time: 5.976 },
+ { offset: 210177, size: 9009, timecode: 5.957, highest_end_time: 6.042 },
],
},
{
url: '/media/resources/media-source/mp4/test.mp4',
type: 'video/mp4; codecs="mp4a.40.2, avc1.4D401E"',
+ // FIXME: Get the init segment duration fixed to match duration after append.
+ // See http://crbug.com/354284.
durationInInitSegment: 6.0368,
duration: 6.0424,
bufferedRangeEndBeforeEndOfStream: 6.0368,
init: { offset: 0, size: 1178 },
media: [
- { offset: 1246, size: 23828, timecode: 0 },
- { offset: 25142, size: 25394, timecode: 0.797 },
- { offset: 50604, size: 24761, timecode: 1.594 },
- { offset: 75433, size: 25138, timecode: 2.390 },
- { offset: 100639, size: 22935, timecode: 3.187 },
- { offset: 123642, size: 24995, timecode: 3.984},
- { offset: 148637, size: 24968, timecode: 4.781 },
- { offset: 173689, size: 19068, timecode: 5.578 },
- { offset: 192757, size: 200, timecode: 5.619 },
+ // FIXME: Fix these timecodes to be PTS, not DTS, and highest_end_times to correspond
+ // to highest PTS+duration, not highest DTS+duration. See http://crbug.com/373039.
+ // FIXME: Some segments are parsed to start with keyframe but DTS < PTS. See
+ // http://crbug.com/371947 and http://crbug.com/367786.
+ { offset: 1246, size: 23828, timecode: 0, highest_end_time: 0.835917 },
+ { offset: 25142, size: 25394, timecode: 0.797, highest_end_time: 1.625395 },
+ { offset: 50604, size: 24761, timecode: 1.594, highest_end_time: 2.414874 },
+ { offset: 75433, size: 25138, timecode: 2.390, highest_end_time: 3.227572 },
+ { offset: 100639, size: 22935, timecode: 3.187, highest_end_time: 4.017051 },
+ { offset: 123642, size: 24995, timecode: 3.984, highest_end_time: 4.806529 },
+ { offset: 148637, size: 24968, timecode: 4.781, highest_end_time: 5.619228 },
+ { offset: 173689, size: 19068, timecode: 5.578, highest_end_time: 6.0424 },
+ { offset: 192757, size: 200, timecode: 5.619, highest_end_time: 6.0424 },
],
}
];
};
window['MediaSourceUtil'] = MediaSourceUtil;
- window['media_test'] = function(testFunction, description, options)
+ window['media_test'] = function(testFunction, description, properties)
{
- options = options || {};
+ properties = properties || {};
return async_test(function(test)
{
addExtraTestMethods(test);
testFunction(test);
- }, description, options);
+ }, description, properties);
};
- window['mediasource_test'] = function(testFunction, description, options)
+ window['mediasource_test'] = function(testFunction, description, properties)
{
return media_test(function(test)
{
{
testFunction(test, mediaTag, mediaSource);
});
- }, description, options);
+ }, description, properties);
};
- window['mediasource_testafterdataloaded'] = function(testFunction, description, options)
+ // In addition to test harness's async_test() properties parameter, this
+ // function recognizes the property allow_media_element_error.
+ window['mediasource_testafterdataloaded'] = function(testFunction, description, properties)
{
mediasource_test(function(test, mediaElement, mediaSource)
{
return;
}
- test.failOnEvent(mediaElement, 'error');
+ if (properties == null || properties.allow_media_element_error == null || !properties.allow_media_element_error)
+ test.failOnEvent(mediaElement, 'error');
var sourceBuffer = mediaSource.addSourceBuffer(segmentInfo.type);
MediaSourceUtil.loadBinaryData(test, segmentInfo.url, function(mediaData)
{
testFunction(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData);
});
- }, description, options);
- }
+ }, description, properties);
+ };
function timeRangesToString(ranges)
{