mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision 132d12daea699ce266324e79eecbe59b10e56502
This commit is contained in:
parent
527d874bc1
commit
fe00a63040
1004 changed files with 18598 additions and 92770 deletions
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>idlharness: Partial dictionary</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Verify the series of sub-tests that are executed for "partial" dictionary objects.</p>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
// No original existence
|
||||
(() => {
|
||||
const idlArray = new IdlArray();
|
||||
idlArray.add_idls('partial dictionary A {};');
|
||||
idlArray.test();
|
||||
})();
|
||||
|
||||
// Multiple partials existence
|
||||
(() => {
|
||||
const idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls('partial dictionary B {};');
|
||||
idlArray.add_idls('partial dictionary B {};');
|
||||
idlArray.add_idls('partial dictionary B {};');
|
||||
idlArray.add_idls('partial dictionary B {};');
|
||||
idlArray.add_idls('dictionary B {};');
|
||||
idlArray.test();
|
||||
})();
|
||||
</script>
|
||||
<script type="text/json" id="expected">
|
||||
{
|
||||
"summarized_status": {
|
||||
"status_string": "OK",
|
||||
"message": null
|
||||
},
|
||||
"summarized_tests": [
|
||||
{
|
||||
"name": "Partial dictionary A: original dictionary defined",
|
||||
"status_string": "FAIL",
|
||||
"properties": {},
|
||||
"message": "assert_true: Original dictionary should be defined expected true got false"
|
||||
},
|
||||
{
|
||||
"name": "Partial dictionary B: original dictionary defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial dictionary B[2]: original dictionary defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial dictionary B[3]: original dictionary defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
}
|
||||
],
|
||||
"type": "complete"
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>idlharness: Partail interface</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Verify the series of sub-tests that are executed for "partial" interface objects.</p>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
// No original existence
|
||||
(() => {
|
||||
const idlArray = new IdlArray();
|
||||
idlArray.add_idls('partial interface A {};');
|
||||
idlArray.test();
|
||||
})();
|
||||
|
||||
// Valid exposure (Note: Worker -> {Shared,Dedicated,Service}Worker)
|
||||
(() => {
|
||||
const idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls(`
|
||||
[Exposed=(Worker)]
|
||||
interface B {};
|
||||
|
||||
[Exposed=(DedicatedWorker, ServiceWorker, SharedWorker)]
|
||||
interface C {};`);
|
||||
idlArray.add_idls(`
|
||||
[Exposed=(DedicatedWorker, ServiceWorker, SharedWorker)]
|
||||
partial interface B {};
|
||||
|
||||
[Exposed=(Worker)]
|
||||
partial interface C {};`);
|
||||
idlArray.collapse_partials();
|
||||
})();
|
||||
|
||||
// Invalid exposure
|
||||
(() => {
|
||||
const idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls(`
|
||||
[Exposed=(Window, ServiceWorker)]
|
||||
interface D {};`);
|
||||
idlArray.add_idls(`
|
||||
[Exposed=(DedicatedWorker)]
|
||||
partial interface D {};`);
|
||||
idlArray.collapse_partials();
|
||||
})();
|
||||
</script>
|
||||
<script type="text/json" id="expected">
|
||||
{
|
||||
"summarized_status": {
|
||||
"status_string": "OK",
|
||||
"message": null
|
||||
},
|
||||
"summarized_tests": [
|
||||
{
|
||||
"name": "Partial interface A: original interface defined",
|
||||
"status_string": "FAIL",
|
||||
"properties": {},
|
||||
"message": "assert_true: Original interface should be defined expected true got false"
|
||||
},
|
||||
{
|
||||
"name": "Partial interface B: original interface defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial interface B: valid exposure set",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial interface C: original interface defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial interface C: valid exposure set",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial interface D: original interface defined",
|
||||
"status_string": "PASS",
|
||||
"properties": {},
|
||||
"message": null
|
||||
},
|
||||
{
|
||||
"name": "Partial interface D: valid exposure set",
|
||||
"status_string": "FAIL",
|
||||
"properties": {},
|
||||
"message": "Partial D interface is exposed to 'DedicatedWorker', the original interface is not."
|
||||
}
|
||||
],
|
||||
"type": "complete"
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -33,12 +33,6 @@ test(() => {
|
|||
let members = idlArray.members["A"].members.map(m => m.name);
|
||||
assert_array_equals(members, ["B", "C"], 'A should contain B, C');
|
||||
}, 'Partial dictionaries');
|
||||
|
||||
test(() => {
|
||||
let idlArray = new IdlArray();
|
||||
idlArray.add_idls('partial dictionary D {};');
|
||||
idlArray.assert_throws('Partial dictionary D with no original dictionary', i => i.test());
|
||||
}, 'Partial-only dictionary definition')
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -29,28 +29,15 @@
|
|||
test(function() {
|
||||
assert_equals(typeof WebIDL2.parse("interface Foo {};"), "object");
|
||||
}, 'WebIDL2 parse method should produce an AST for correct WebIDL');
|
||||
for (let type of ['dictionary', 'interface']) {
|
||||
test(function() {
|
||||
test(function () {
|
||||
try {
|
||||
let i = new IdlArray();
|
||||
i.add_untested_idls(`partial ${type} A {};`);
|
||||
i.assert_throws(new IdlHarnessError(`Partial ${type} A with no original ${type}`), i => i.test());
|
||||
}, `assert_throws should handle ${type} IdlHarnessError`);
|
||||
test(function() {
|
||||
let i = new IdlArray();
|
||||
i.add_untested_idls(`partial ${type} A {};`);
|
||||
i.assert_throws(`Partial ${type} A with no original ${type}`, i => i.test());
|
||||
}, `assert_throws should handle ${type} IdlHarnessError from message`);
|
||||
test(function () {
|
||||
try {
|
||||
let i = new IdlArray();
|
||||
i.add_untested_idls(`${type} A {};`);
|
||||
i.assert_throws(`Partial ${type} A with no original ${type}`, i => i.test());
|
||||
} catch (e) {
|
||||
assert_true(e instanceof IdlHarnessError);
|
||||
}
|
||||
}, `assert_throws should throw if no ${type} IdlHarnessError thrown`);
|
||||
}
|
||||
i.add_untested_idls(`interface C {};`);
|
||||
i.assert_throws('Anything', i => i.test());
|
||||
} catch (e) {
|
||||
assert_true(e instanceof IdlHarnessError);
|
||||
}
|
||||
}, `assert_throws should throw if no IdlHarnessError thrown`);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue