mirror of
https://github.com/servo/servo.git
synced 2025-09-11 15:38:24 +01:00
Wrap more of the referrer-policy tests in testharness.js.
This commit is contained in:
parent
bffe2a699e
commit
3cd6df1ef9
30 changed files with 540 additions and 583 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue