mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 181f8381fe9373e027f4b5ba5d1439843ad2c2e6
This commit is contained in:
parent
0dda115609
commit
0355b8e70d
105 changed files with 2775 additions and 764 deletions
|
@ -14,41 +14,34 @@ var svg_test_properties = [
|
|||
'mask-image',
|
||||
];
|
||||
|
||||
// Schedules async_test's for each of the test properties
|
||||
// Parameters:
|
||||
// testProperties: An array of test properties.
|
||||
// testDescription: A test description
|
||||
// testFunction: A function call which sets up the expect result and runs
|
||||
// the actual test
|
||||
function runSvgTests(testProperties, testDescription, testFunction) {
|
||||
let runNextTest = function () {
|
||||
let property = testProperties.shift();
|
||||
if (property === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const property of testProperties) {
|
||||
let current = {
|
||||
test: async_test(testDescription + " " + property),
|
||||
id: token(),
|
||||
property: property,
|
||||
};
|
||||
|
||||
current.test.step(function() { testFunction(current) });
|
||||
|
||||
let check_url = url_prefix + "svg.py" + "?id=" + current.id +
|
||||
"&report-headers";
|
||||
current.test.step_timeout(function() {
|
||||
queryXhr(check_url, function(message) {
|
||||
assert_own_property(message, "headers");
|
||||
assert_own_property(message, "referrer");
|
||||
assert_equals(message.referrer, current.expected);
|
||||
current.test.done();
|
||||
}, null, null, current.test);
|
||||
}, 800);
|
||||
};
|
||||
|
||||
add_result_callback(runNextTest);
|
||||
runNextTest();
|
||||
promise_test(t => {
|
||||
testFunction(current);
|
||||
return timeoutPromise(t, 800)
|
||||
.then(() => {
|
||||
let check_url = url_prefix + "svg.py" + "?id=" + current.id +
|
||||
"&report-headers";
|
||||
return requestViaFetch(check_url);
|
||||
})
|
||||
.then(message => {
|
||||
assert_own_property(message, "headers");
|
||||
assert_own_property(message, "referrer");
|
||||
assert_equals(message.referrer, current.expected);
|
||||
});
|
||||
},
|
||||
testDescription + " " + property);
|
||||
}
|
||||
}
|
||||
|
||||
function createSvg() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue