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

@ -24,22 +24,21 @@
if (!window.fetch)
return;
var fetch_test = async_test("Fetch is responding with HTTP headers");
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
var url = location.protocol + "//" + location.hostname + ":" +
location.port + urlPath;
queryFetch(url, function(message) {
var pre = document.getElementById('received_message')
var headers = message.headers;
pre.innerHTML = "";
pre.innerHTML += url + ":\n\n";
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n";
fetch_test.step(function() {
async_test(function(fetch_test) {
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
var url = location.protocol + "//" + location.hostname + ":" +
location.port + urlPath;
queryFetch(url, function(message) {
var pre = document.getElementById('received_message')
var headers = message.headers;
pre.innerHTML = "";
pre.innerHTML += url + ":\n\n";
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n";
assert_own_property(headers, "host")
assert_own_property(headers, "connection")
});
fetch_test.done();
});
fetch_test.done();
}, null, null, fetch_test);
}, "Fetch is responding with HTTP headers");
})();
</script>