mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision abd18b3e018d25ed668d179c905b7869dca5e239
This commit is contained in:
parent
908a642063
commit
158f7eec0e
117 changed files with 2997 additions and 434 deletions
|
@ -3167,27 +3167,32 @@ IdlNamespace.prototype.test = function ()
|
|||
* as adding objects. Do not call idl_array.test() in the setup; it is
|
||||
* called by this function (idl_test).
|
||||
*/
|
||||
function idl_test(srcs, deps, setup_func, test_name) {
|
||||
function idl_test(srcs, deps, idl_setup_func, test_name) {
|
||||
return promise_test(function (t) {
|
||||
var idl_array = new IdlArray();
|
||||
srcs = (srcs instanceof Array) ? srcs : [srcs] || [];
|
||||
deps = (deps instanceof Array) ? deps : [deps] || [];
|
||||
return Promise.all(
|
||||
srcs.concat(deps).map(function(i) {
|
||||
return fetch('/interfaces/' + i + '.idl').then(function(r) {
|
||||
srcs.concat(deps).map(function(spec) {
|
||||
return fetch('/interfaces/' + spec + '.idl').then(function(r) {
|
||||
return r.text();
|
||||
});
|
||||
})).then(function(idls) {
|
||||
}))
|
||||
.then(function(idls) {
|
||||
for (var i = 0; i < srcs.length; i++) {
|
||||
idl_array.add_idls(idls[i]);
|
||||
}
|
||||
for (var i = srcs.length; i < srcs.length + deps.length; i++) {
|
||||
idl_array.add_dependency_idls(idls[i]);
|
||||
}
|
||||
if (setup_func) {
|
||||
setup_func(idl_array)
|
||||
};
|
||||
idl_array.test();
|
||||
})
|
||||
.then(function() {
|
||||
return idl_setup_func(idl_array, t);
|
||||
})
|
||||
.then(function() { idl_array.test(); })
|
||||
.catch(function (reason) {
|
||||
idl_array.test(); // Test what we can.
|
||||
return Promise.reject(reason || 'IDL setup failed.');
|
||||
});
|
||||
}, test_name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue