Wrap more of the referrer-policy tests in testharness.js.

This commit is contained in:
Josh Matthews 2018-12-20 16:14:15 -05:00
parent bffe2a699e
commit 3cd6df1ef9
30 changed files with 540 additions and 583 deletions

View file

@ -33,22 +33,18 @@ function runSvgTests(testProperties, testDescription, testFunction) {
property: property,
};
testFunction(current);
current.test.step(function() { testFunction(current) });
let check_url = url_prefix + "svg.py" + "?id=" + current.id +
"&report-headers";
current.test.step_timeout(
queryXhr.bind(this, check_url,
function(message) {
current.test.step(function() {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, current.expected);
});
current.test.done();
}),
800);
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);