mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision e1edaa3dd1bea4415ee88e042affee32028d7f1d
This commit is contained in:
parent
0bd2661492
commit
0cb6acf9a2
4828 changed files with 87680 additions and 41620 deletions
|
@ -18,7 +18,7 @@ function assert_valid(syntax, initialValue) {
|
|||
function assert_invalid(syntax, initialValue) {
|
||||
test(function(){
|
||||
var name = '--syntax-test-' + (test_count++);
|
||||
assert_throws(new SyntaxError(),
|
||||
assert_throws_dom("SyntaxError",
|
||||
() => CSS.registerProperty({name: name, syntax: syntax, initialValue: initialValue, inherits: false}));
|
||||
}, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is invalid");
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// Tests for error checking during property registration
|
||||
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty());
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty(undefined));
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty(true));
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty(2));
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty("css"));
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty(null));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty());
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty(undefined));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty(true));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty(2));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty("css"));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty(null));
|
||||
}, "registerProperty requires a Dictionary type");
|
||||
|
||||
test(function() {
|
||||
|
@ -23,29 +23,29 @@ test(function() {
|
|||
CSS.registerProperty({name: ['--name', 3], inherits: false});
|
||||
|
||||
// Invalid property names
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty({}));
|
||||
assert_throws(new SyntaxError(), () => CSS.registerProperty({name: 'no-leading-dash', inherits: false}));
|
||||
assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '', inherits: false}));
|
||||
assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '\\--name', inherits: false}));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty({}));
|
||||
assert_throws_dom("SyntaxError", () => CSS.registerProperty({name: 'no-leading-dash', inherits: false}));
|
||||
assert_throws_dom("SyntaxError", () => CSS.registerProperty({name: '', inherits: false}));
|
||||
assert_throws_dom("SyntaxError", () => CSS.registerProperty({name: '\\--name', inherits: false}));
|
||||
}, "registerProperty requires a name matching <custom-property-name>");
|
||||
|
||||
test(function() {
|
||||
CSS.registerProperty({name: '--syntax-test-1', syntax: '*', inherits: false});
|
||||
CSS.registerProperty({name: '--syntax-test-2', syntax: ' * ', inherits: false});
|
||||
assert_throws(new SyntaxError(),
|
||||
assert_throws_dom("SyntaxError",
|
||||
() => CSS.registerProperty({name: '--syntax-test-3', syntax: 'length', inherits: false}));
|
||||
}, "registerProperty only allows omitting initialValue if syntax is '*'");
|
||||
|
||||
test(function() {
|
||||
CSS.registerProperty({name: '--re-register', syntax: '<length>', initialValue: '0px', inherits: false});
|
||||
assert_throws({name: 'InvalidModificationError'},
|
||||
assert_throws_dom('InvalidModificationError',
|
||||
() => CSS.registerProperty({name: '--re-register', syntax: '<percentage>', initialValue: '0%', inherits: false}));
|
||||
}, "registerProperty fails for an already registered property");
|
||||
|
||||
test(function(){
|
||||
CSS.registerProperty({name: '--inherit-test-1', syntax: '<length>', initialValue: '0px', inherits: true});
|
||||
CSS.registerProperty({name: '--inherit-test-2', syntax: '<length>', initialValue: '0px', inherits: false});
|
||||
assert_throws(new TypeError(), () => CSS.registerProperty({name: '--inherit-test-3', syntax: '<length>', initialValue: '0px'}));
|
||||
assert_throws_js(TypeError, () => CSS.registerProperty({name: '--inherit-test-3', syntax: '<length>', initialValue: '0px'}));
|
||||
}, "registerProperty requires inherits");
|
||||
|
||||
test(function(){
|
||||
|
|
|
@ -33,9 +33,9 @@ test(function(){
|
|||
}, 'Generated properties respect inherits flag');
|
||||
|
||||
test(function(){
|
||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', foo: 1}));
|
||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', inherited: false}));
|
||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', initial: '10px'}));
|
||||
assert_throws_js(Error, () => generate_property({syntax: '<length>', foo: 1}));
|
||||
assert_throws_js(Error, () => generate_property({syntax: '<length>', inherited: false}));
|
||||
assert_throws_js(Error, () => generate_property({syntax: '<length>', initial: '10px'}));
|
||||
}, 'Can\'t generate property with unknown fields');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -44,14 +44,14 @@ function verify_map_set(map, name, value) {
|
|||
|
||||
// Verifies that the specified value is NOT accepted by set().
|
||||
function verify_map_not_set(map, name, value) {
|
||||
assert_throws(new TypeError(), () => {
|
||||
assert_throws_js(TypeError, () => {
|
||||
map.set(name, value);
|
||||
});
|
||||
}
|
||||
|
||||
// Verifies that the specified value is NOT accepted by append().
|
||||
function verify_map_no_append(map, name, value) {
|
||||
assert_throws(new TypeError(), () => {
|
||||
assert_throws_js(TypeError, () => {
|
||||
map.append(name, value);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue