mirror of
https://github.com/servo/servo.git
synced 2025-09-12 07:58:20 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -50,29 +50,29 @@ Guidelines for writing tests
|
|||
|
||||
e.g.
|
||||
|
||||
```javascript
|
||||
test(function(t) {
|
||||
var anim = createDiv(t).animate(null);
|
||||
assert_class_string(anim, 'Animation', 'Returned object is an Animation');
|
||||
}, 'Element.animate() creates an Animation object');
|
||||
```
|
||||
```javascript
|
||||
test(function(t) {
|
||||
const animation = createDiv(t).animate(null);
|
||||
assert_class_string(animation, 'Animation', 'Returned object is an Animation');
|
||||
}, 'Element.animate() creates an Animation object');
|
||||
```
|
||||
|
||||
```javascript
|
||||
test(function(t) {
|
||||
assert_throws({ name: 'TypeError' }, function() {
|
||||
createDiv(t).animate(null, -1);
|
||||
});
|
||||
}, 'Setting a negative duration throws a TypeError');
|
||||
```
|
||||
```javascript
|
||||
test(function(t) {
|
||||
assert_throws({ name: 'TypeError' }, function() {
|
||||
createDiv(t).animate(null, -1);
|
||||
});
|
||||
}, 'Setting a negative duration throws a TypeError');
|
||||
```
|
||||
|
||||
```javascript
|
||||
promise_test(function(t) {
|
||||
var animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
|
||||
return animation.ready.then(function() {
|
||||
assert_greater_than(animation.startTime, 0, 'startTime when running');
|
||||
});
|
||||
}, 'startTime is resolved when running');
|
||||
```
|
||||
```javascript
|
||||
promise_test(function(t) {
|
||||
const animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
|
||||
return animation.ready.then(function() {
|
||||
assert_greater_than(animation.startTime, 0, 'startTime when running');
|
||||
});
|
||||
}, 'startTime is resolved when running');
|
||||
```
|
||||
|
||||
If you're generating complex test loops and factoring out utility functions
|
||||
that affect the logic of the test (other than, say, simple assertion utility
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue