mirror of
https://github.com/servo/servo.git
synced 2025-07-01 12:33:40 +01:00
44 lines
1.4 KiB
HTML
44 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/fetch/sec-metadata/resources/helper.js></script>
|
|
<script>
|
|
promise_test(t => {
|
|
return fetch("https://{{host}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py")
|
|
.then(r => r.json())
|
|
.then(j => {
|
|
assert_header_equals(j.header, {
|
|
"cause": "forced",
|
|
"destination": "\"\"",
|
|
"target": "subresource",
|
|
"site": "same-origin"
|
|
});
|
|
});
|
|
}, "Same-origin fetch");
|
|
|
|
promise_test(t => {
|
|
return fetch("https://{{hosts[][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py")
|
|
.then(r => r.json())
|
|
.then(j => {
|
|
assert_header_equals(j.header, {
|
|
"cause": "forced",
|
|
"destination": "\"\"",
|
|
"target": "subresource",
|
|
"site": "same-site"
|
|
});
|
|
});
|
|
}, "Same-site fetch");
|
|
|
|
promise_test(t => {
|
|
return fetch("https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py")
|
|
.then(r => r.json())
|
|
.then(j => {
|
|
assert_header_equals(j.header, {
|
|
"cause": "forced",
|
|
"destination": "\"\"",
|
|
"target": "subresource",
|
|
"site": "cross-site"
|
|
});
|
|
});
|
|
}, "Cross-site fetch");
|
|
</script>
|