mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Update web-platform-tests to revision 04bc9c5667911cce7361ee33244dfc8d7ed61212
This commit is contained in:
parent
156b1cc891
commit
0d3d7c36ab
51 changed files with 843 additions and 298 deletions
|
@ -44,23 +44,26 @@ function runTest(config,qualifier) {
|
|||
|
||||
assert_in_array(event.messageType, ['license-request', 'individualization-request']);
|
||||
|
||||
// Generate a license that expires 1 second from now.
|
||||
var expiration = Date.now().valueOf() + 1000;
|
||||
config.messagehandler(event.messageType, event.message, { expiration: expiration }).then(function(response) {
|
||||
return event.target.update(response);
|
||||
}).then(test.step_func(function() {
|
||||
// License server may only have second granularity, so check
|
||||
// that session expiration time is close to the desired value.
|
||||
assert_approx_equals(event.target.expiration, expiration, 2000, "expiration attribute should equal provided expiration time");
|
||||
|
||||
// Since the expiration time is in the future, wait 5 seconds
|
||||
// so that the license has expired before calling play().
|
||||
// Wait 2 seconds before calling update() to ensure that the
|
||||
// license has really expired. This is to avoid problems
|
||||
// where the browser starts buffering frames as soon as a
|
||||
// valid license is received.
|
||||
test.step_timeout(function() {
|
||||
assert_greater_than(Date.now().valueOf(), expiration, "Starting play before license expired");
|
||||
_video.play();
|
||||
// Wait 2 seconds to ensure that the video does not play.
|
||||
test.step_timeout(function() { test.done(); }, 2000);
|
||||
}, 5000);
|
||||
})).catch(onFailure);
|
||||
event.target.update(response).then(function() {
|
||||
// License server may only have second granularity, so check
|
||||
// that session expiration time is close to the desired value.
|
||||
assert_approx_equals(event.target.expiration, expiration, 3000,
|
||||
"expiration attribute should equal provided expiration time");
|
||||
assert_greater_than(Date.now().valueOf(), expiration, "Starting play before license expired");
|
||||
_video.play();
|
||||
// Wait 2 seconds to ensure that the video does not play.
|
||||
test.step_timeout(function() { test.done(); }, 2000);
|
||||
}).catch(onFailure);
|
||||
}, 2000);
|
||||
}).catch(onFailure);
|
||||
}
|
||||
|
||||
function onPlaying(event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue