mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -2,9 +2,9 @@ function runTest(config,qualifier) {
|
|||
|
||||
// This test assumes one session is required for each provided initData
|
||||
|
||||
var testname = testnamePrefix( qualifier, config.keysystem )
|
||||
var testname = testnamePrefix(qualifier, config.keysystem)
|
||||
+ ', temporary, '
|
||||
+ /video\/([^;]*)/.exec( config.videoType )[ 1 ]
|
||||
+ /video\/([^;]*)/.exec(config.videoType)[1]
|
||||
+ ', playback with multiple sessions, '
|
||||
+ config.testcase;
|
||||
|
||||
|
@ -13,27 +13,26 @@ function runTest(config,qualifier) {
|
|||
videoCapabilities: [ { contentType: config.videoType } ],
|
||||
sessionTypes: [ 'temporary' ] };
|
||||
|
||||
async_test( function( test ) {
|
||||
|
||||
async_test(function(test) {
|
||||
var _video = config.video,
|
||||
_mediaKeys,
|
||||
_mediaKeySessions = [ ],
|
||||
_mediaKeySessions = [],
|
||||
_mediaSource;
|
||||
|
||||
function onFailure( error ) {
|
||||
function onFailure(error) {
|
||||
forceTestFailureFromPromise(test, error);
|
||||
}
|
||||
|
||||
function onMessage(event) {
|
||||
assert_any( assert_equals, event.target, _mediaKeySessions );
|
||||
assert_true( event instanceof window.MediaKeyMessageEvent );
|
||||
assert_equals( event.type, 'message');
|
||||
assert_any(assert_equals, event.target, _mediaKeySessions);
|
||||
assert_true(event instanceof window.MediaKeyMessageEvent);
|
||||
assert_equals(event.type, 'message');
|
||||
|
||||
assert_in_array( event.messageType, [ 'license-request', 'individualization-request' ] );
|
||||
assert_in_array(event.messageType, ['license-request', 'individualization-request']);
|
||||
|
||||
config.messagehandler( event.messageType, event.message ).then( function( response ) {
|
||||
event.target.update( response ).catch(onFailure);
|
||||
});
|
||||
config.messagehandler(event.messageType, event.message, {variantId: event.target._variantId}).then(function(response) {
|
||||
return event.target.update(response);
|
||||
}).catch(onFailure);
|
||||
}
|
||||
|
||||
function onPlaying(event) {
|
||||
|
@ -43,14 +42,14 @@ function runTest(config,qualifier) {
|
|||
}
|
||||
|
||||
function onTimeupdate(event) {
|
||||
if ( _video.currentTime > ( config.duration || 1 ) ) {
|
||||
if (_video.currentTime > (config.duration || 1)) {
|
||||
_video.removeEventListener('timeupdate', onTimeupdate);
|
||||
_video.pause();
|
||||
test.done();
|
||||
}
|
||||
}
|
||||
|
||||
navigator.requestMediaKeySystemAccess(config.keysystem, [ configuration ]).then(function(access) {
|
||||
navigator.requestMediaKeySystemAccess(config.keysystem, [configuration]).then(function(access) {
|
||||
return access.createMediaKeys();
|
||||
}).then(function(mediaKeys) {
|
||||
_mediaKeys = mediaKeys;
|
||||
|
@ -58,16 +57,19 @@ function runTest(config,qualifier) {
|
|||
}).then(function() {
|
||||
waitForEventAndRunStep('playing', _video, onPlaying, test);
|
||||
|
||||
config.initData.forEach( function( initData ) {
|
||||
config.initData.forEach(function(initData,i) {
|
||||
var mediaKeySession = _mediaKeys.createSession( 'temporary' );
|
||||
mediaKeySession._variantId = config.variantIds ? config.variantIds[i] : undefined;
|
||||
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
|
||||
_mediaKeySessions.push( mediaKeySession );
|
||||
mediaKeySession.generateRequest( config.initDataType, initData ).catch( onFailure );
|
||||
_mediaKeySessions.push(mediaKeySession);
|
||||
mediaKeySession.generateRequest(config.initDataType, initData).catch(onFailure);
|
||||
} );
|
||||
return testmediasource(config);
|
||||
}).then(function(source) {
|
||||
_mediaSource = source;
|
||||
_video.src = URL.createObjectURL(_mediaSource);
|
||||
return source.done;
|
||||
}).then(function(){
|
||||
_video.play();
|
||||
}).catch(onFailure);
|
||||
}, testname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue