mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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
|
@ -650073,67 +650073,67 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/child-css/external-import-stylesheet.html": [
|
"referrer-policy/css-integration/child-css/external-import-stylesheet.html": [
|
||||||
"a2d3e8ced0412b97422847d4d81c1403cf9ae52c",
|
"40f4234ad48d19162cefae933fd0f53a72ff0c19",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/child-css/internal-import-stylesheet.html": [
|
"referrer-policy/css-integration/child-css/internal-import-stylesheet.html": [
|
||||||
"aebf5031484b799989d6b6a9dd72a5bc28575214",
|
"30c5ea2903094af38dea9a7a565255d178069178",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/child-css/processing-instruction.html": [
|
"referrer-policy/css-integration/child-css/processing-instruction.html": [
|
||||||
"b6333e2c7b248c3f3b863bd06f1c99abd472f162",
|
"52a0ded42a185ed5ff6f449879e0ce50f8255868",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/css-test-helper.js": [
|
"referrer-policy/css-integration/css-test-helper.js": [
|
||||||
"f5886dbbcbe358438dfbac45c5a0127e9e990ad4",
|
"788df16a456b83a23de662b710c200042a1e7254",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/font-face/external-import-stylesheet.html": [
|
"referrer-policy/css-integration/font-face/external-import-stylesheet.html": [
|
||||||
"c344c56c5bf322f35e8d8c74427d80391e6637d3",
|
"80e3587ad62f040f2cfb28645437fcbc0e66b415",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/font-face/external-stylesheet.html": [
|
"referrer-policy/css-integration/font-face/external-stylesheet.html": [
|
||||||
"24e4bb99900a556cb0b44144a25c9f8249224eb7",
|
"a91eb3fe758299229040466deb2d1b0263f77197",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/font-face/internal-import-stylesheet.html": [
|
"referrer-policy/css-integration/font-face/internal-import-stylesheet.html": [
|
||||||
"54e2383423cab8679635d05c256c32e27a94c024",
|
"a637082a4ce7dff612b223fc8a4c2195db300013",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/font-face/internal-stylesheet.html": [
|
"referrer-policy/css-integration/font-face/internal-stylesheet.html": [
|
||||||
"b3869bcebdcdadea3e50d7e8713c853d46ba4816",
|
"eebd864bc56725b79c1f29c0597466574e2af091",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/font-face/processing-instruction.html": [
|
"referrer-policy/css-integration/font-face/processing-instruction.html": [
|
||||||
"89ee918e24e14b8ea5d35a7dfaf09610eb89ee11",
|
"bfc42d9fcbe355514c7bf72ac087d7159439824e",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/external-import-stylesheet.html": [
|
"referrer-policy/css-integration/image/external-import-stylesheet.html": [
|
||||||
"0023af31b17ee883e6e9fe6cdd8f09b8eacf83d1",
|
"80c71b0e215b547d664aee8757d70188c012a9c0",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/external-stylesheet.html": [
|
"referrer-policy/css-integration/image/external-stylesheet.html": [
|
||||||
"d14769db4a1221bb6e220aa594c4a3b6bab97aa1",
|
"ba7497b97de6911c149b423bf25305123e97150e",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/inline-style.html": [
|
"referrer-policy/css-integration/image/inline-style.html": [
|
||||||
"42128ae062093c0e8feb5d90ab62a6cb281cf8e9",
|
"758b6d91852f67d4e47726815804a5e366fe534d",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/internal-import-stylesheet.html": [
|
"referrer-policy/css-integration/image/internal-import-stylesheet.html": [
|
||||||
"90003547f4d4e2048cc33f7125d756d42507140d",
|
"24aa1858304a2130624589b0a64c6f9ec9cac5a1",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/internal-stylesheet.html": [
|
"referrer-policy/css-integration/image/internal-stylesheet.html": [
|
||||||
"943108d66e4b273a6d3be30b2ea8a0edb0490c7b",
|
"f4567885e1f1e215487a11f1023d117517cd88b8",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/presentation-attribute.html": [
|
"referrer-policy/css-integration/image/presentation-attribute.html": [
|
||||||
"78401d3ec16866f1e51618bdb5cb028f5eea8490",
|
"d0a4d96f84c8e48ea5daf5699c7b04bbc877ba86",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/image/processing-instruction.html": [
|
"referrer-policy/css-integration/image/processing-instruction.html": [
|
||||||
"1ca18547dd54c4707250f400999a041f16f77ddf",
|
"926147be489a85164758dcf644c715e4a5c02de6",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/css-integration/svg/external-stylesheet.html": [
|
"referrer-policy/css-integration/svg/external-stylesheet.html": [
|
||||||
|
@ -650157,7 +650157,7 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/common.js": [
|
"referrer-policy/generic/common.js": [
|
||||||
"f9bbe42b914c46822ec8b74aacd849789723dd72",
|
"a16691bccb2543ad68b81e9a16fa261d3cce6a9f",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/iframe-inheritance.html": [
|
"referrer-policy/generic/iframe-inheritance.html": [
|
||||||
|
@ -650209,11 +650209,11 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/referrer-policy-test-case.js": [
|
"referrer-policy/generic/referrer-policy-test-case.js": [
|
||||||
"4641683cd850da86279dcd062aaf868d346aa2bd",
|
"2385cc2a1c4e51a2855299e42b69ac12362cd699",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html": [
|
"referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html": [
|
||||||
"8fee77f836378ec137c3bf0d554f4def83a5caba",
|
"1b2b12bf6910e075338462de577dc4228f52a21f",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/sanity-checker.js": [
|
"referrer-policy/generic/sanity-checker.js": [
|
||||||
|
@ -650221,7 +650221,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/area-navigate.html": [
|
"referrer-policy/generic/subresource-test/area-navigate.html": [
|
||||||
"bca7e479fa2ca41505bc73cf74c6e518efa7e947",
|
"3eb824521b7801c518a7b36218075eb3d74bd639",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html": [
|
"referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html": [
|
||||||
|
@ -650229,31 +650229,31 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/fetch-messaging.html": [
|
"referrer-policy/generic/subresource-test/fetch-messaging.html": [
|
||||||
"046b29e9a3e94753c1a552732b0f44d2883a011d",
|
"edb159d9eb1cf5eed6af249a40f70d9ecd079d68",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/iframe-messaging.html": [
|
"referrer-policy/generic/subresource-test/iframe-messaging.html": [
|
||||||
"a3e55707c26f95624baaa54b8778d641cd756d72",
|
"606e18b281f6c3498573dc9bfaefefca1390026a",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/image-decoding.html": [
|
"referrer-policy/generic/subresource-test/image-decoding.html": [
|
||||||
"448f12b1348fa77aaaebd52b2c3ee6ae9c73a5f6",
|
"9c50ea6619389dad8ad81c4c2afbeb8030b176db",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/link-navigate.html": [
|
"referrer-policy/generic/subresource-test/link-navigate.html": [
|
||||||
"45e502004d4b640d0b2194e48d060b8d3cc3f120",
|
"95582f65bac8a3b478cc8cd4fe9b883fb507237f",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/script-messaging.html": [
|
"referrer-policy/generic/subresource-test/script-messaging.html": [
|
||||||
"09c5db6193fed52c60edc2526609c3d501c45da8",
|
"f73f4406df20694480f82570ed8674fe283ea375",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/worker-messaging.html": [
|
"referrer-policy/generic/subresource-test/worker-messaging.html": [
|
||||||
"6d34366b943ad2b3b15f08179a58ef5227c675d0",
|
"fd7591882e91e7265fd740b9018248d21f13b5b9",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource-test/xhr-messaging.html": [
|
"referrer-policy/generic/subresource-test/xhr-messaging.html": [
|
||||||
"09f69140098a16bd66a117cf6187fedc862d9233",
|
"6ef4a9cfd4b98c3562fe7ef6e04eb931073166de",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/subresource/__init__.py": [
|
"referrer-policy/generic/subresource/__init__.py": [
|
||||||
|
@ -650381,7 +650381,7 @@
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
"referrer-policy/generic/unsupported-csp-referrer-directive.html": [
|
"referrer-policy/generic/unsupported-csp-referrer-directive.html": [
|
||||||
"9627d16559903b5202f842f3c3355a2e7005f65c",
|
"475efa55091778e747fa36030f7b422b89d6d4b9",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html": [
|
"referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html": [
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[unsupported-csp-referrer-directive.html]
|
|
||||||
type: testharness
|
|
||||||
disabled: https://github.com/servo/servo/issues/4767
|
|
|
@ -16,31 +16,29 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Child css from external stylesheet.");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
let css_url = url_prefix +
|
let css_url = url_prefix +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
||||||
"&import-rule" + "&referrer-policy=no-referrer";
|
"&import-rule" + "&referrer-policy=no-referrer";
|
||||||
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
|
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
let link = document.createElement("link");
|
let link = document.createElement("link");
|
||||||
link.href = css_url;
|
link.href = css_url;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.onload = function() {
|
link.onload = function() {
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, check_url,
|
queryXhr(check_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_equals(message.referrer, undefined);
|
||||||
assert_own_property(message, "headers");
|
css_test.done();
|
||||||
assert_equals(message.referrer, undefined);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
};
|
||||||
}),
|
document.head.appendChild(link);
|
||||||
1000);
|
}, "Child css from external stylesheet.");
|
||||||
};
|
|
||||||
document.head.appendChild(link);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,28 +16,26 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Child css from internal stylesheet.");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&import-rule";
|
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&import-rule";
|
||||||
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
|
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
let style = document.createElement("style");
|
let style = document.createElement("style");
|
||||||
style.type = 'text/css';
|
style.type = 'text/css';
|
||||||
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
|
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, check_url,
|
queryXhr(check_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Child css from internal stylesheet.");
|
||||||
}),
|
|
||||||
1000);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -15,31 +15,29 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Child css via a ProcessingInstruction.");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
|
||||||
location.port +
|
location.port +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
||||||
id;
|
id;
|
||||||
let css_url = url_prefix + "&import-rule";
|
let css_url = url_prefix + "&import-rule";
|
||||||
let expected = url_prefix + "&import-rule";
|
let expected = url_prefix + "&import-rule";
|
||||||
let check_url = url_prefix + "&report-headers";
|
let check_url = url_prefix + "&report-headers";
|
||||||
|
|
||||||
let processingInstruction =
|
let processingInstruction =
|
||||||
document.createProcessingInstruction(
|
document.createProcessingInstruction(
|
||||||
"xml-stylesheet", "href=\"" +css_url + "\" type=\"text/css\"");
|
"xml-stylesheet", "href=\"" +css_url + "\" type=\"text/css\"");
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, check_url,
|
queryXhr(check_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, expected);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, expected);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
document.insertBefore(processingInstruction, document.firstChild);
|
||||||
}),
|
}, "Child css via a ProcessingInstruction.");
|
||||||
1000);
|
|
||||||
document.insertBefore(processingInstruction, document.firstChild);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -33,22 +33,18 @@ function runSvgTests(testProperties, testDescription, testFunction) {
|
||||||
property: property,
|
property: property,
|
||||||
};
|
};
|
||||||
|
|
||||||
testFunction(current);
|
current.test.step(function() { testFunction(current) });
|
||||||
|
|
||||||
let check_url = url_prefix + "svg.py" + "?id=" + current.id +
|
let check_url = url_prefix + "svg.py" + "?id=" + current.id +
|
||||||
"&report-headers";
|
"&report-headers";
|
||||||
current.test.step_timeout(
|
current.test.step_timeout(function() {
|
||||||
queryXhr.bind(this, check_url,
|
queryXhr(check_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
current.test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, current.expected);
|
||||||
assert_own_property(message, "referrer");
|
current.test.done();
|
||||||
assert_equals(message.referrer, current.expected);
|
}, null, null, current.test);
|
||||||
});
|
}, 800);
|
||||||
current.test.done();
|
|
||||||
}),
|
|
||||||
800);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
add_result_callback(runNextTest);
|
add_result_callback(runNextTest);
|
||||||
|
|
|
@ -17,35 +17,33 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Font from imported stylesheet (external).");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let css_url = location.protocol + "//www1." + location.hostname + ":" +
|
let css_url = location.protocol + "//www1." + location.hostname + ":" +
|
||||||
location.port +
|
location.port +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
||||||
"&import-rule" + "&type=font";
|
"&import-rule" + "&type=font";
|
||||||
let url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
|
let url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
|
||||||
let css_referrer = url_prefix +
|
let css_referrer = url_prefix +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font";
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font";
|
||||||
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
||||||
"?id=" + id + "&report-headers" + "&type=font";
|
"?id=" + id + "&report-headers" + "&type=font";
|
||||||
|
|
||||||
let link = document.createElement("link");
|
let link = document.createElement("link");
|
||||||
link.href = css_url;
|
link.href = css_url;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.onload = function() {
|
link.onload = function() {
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, font_url,
|
queryXhr(font_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_referrer);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_referrer);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
};
|
||||||
}),
|
document.head.appendChild(link);
|
||||||
1000);
|
}, "Font from imported stylesheet (external).");
|
||||||
};
|
|
||||||
document.head.appendChild(link);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,30 +16,28 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Font from external stylesheet.");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font";
|
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font";
|
||||||
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
let link = document.createElement("link");
|
let link = document.createElement("link");
|
||||||
link.href = css_url;
|
link.href = css_url;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.onload = function() {
|
link.onload = function() {
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, font_url,
|
queryXhr(font_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
};
|
||||||
}),
|
document.head.appendChild(link);
|
||||||
1000);
|
}, "Font from external stylesheet.");
|
||||||
};
|
|
||||||
document.head.appendChild(link);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -17,28 +17,26 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Font from imported stylesheet (internal).");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
|
||||||
location.port + "/referrer-policy/generic/subresource/";
|
location.port + "/referrer-policy/generic/subresource/";
|
||||||
let css_url = url_prefix + "stylesheet.py?id=" + id + "&type=font";
|
let css_url = url_prefix + "stylesheet.py?id=" + id + "&type=font";
|
||||||
let font_url = url_prefix + "font.py?report-headers&id=" + id;
|
let font_url = url_prefix + "font.py?report-headers&id=" + id;
|
||||||
|
|
||||||
let style = document.createElement("style");
|
let style = document.createElement("style");
|
||||||
style.textContent = "@import url('" + css_url + "');";
|
style.textContent = "@import url('" + css_url + "');";
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, font_url,
|
queryXhr(font_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Font from imported stylesheet (internal).");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -16,29 +16,27 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Font from internal stylesheet.");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let css_url = location.protocol + "//www1." + location.hostname + ":" +
|
let css_url = location.protocol + "//www1." + location.hostname + ":" +
|
||||||
location.port +
|
location.port +
|
||||||
"/referrer-policy/generic/subresource/font.py" + "?id=" +
|
"/referrer-policy/generic/subresource/font.py" + "?id=" +
|
||||||
id + "&type=font";
|
id + "&type=font";
|
||||||
let font_url = css_url + "&report-headers";
|
let font_url = css_url + "&report-headers";
|
||||||
|
|
||||||
let style = document.createElement("style");
|
let style = document.createElement("style");
|
||||||
style.textContent = "@font-face { font-family: 'wpt'; font-style: normal; font-weight: normal; src: url(" + css_url + "); format('truetype'); } body { font-family: 'wpt';}";
|
style.textContent = "@font-face { font-family: 'wpt'; font-style: normal; font-weight: normal; src: url(" + css_url + "); format('truetype'); } body { font-family: 'wpt';}";
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, font_url,
|
queryXhr(font_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, location.origin + "/");
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, location.origin + "/");
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Font from internal stylesheet.");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -17,33 +17,31 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let css_test = async_test("Font from external stylesheet (from ProcessingInstruction).");
|
async_test(function(css_test) {
|
||||||
let id = token();
|
let id = token();
|
||||||
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
let css_url = url_prefix +
|
let css_url = url_prefix +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
||||||
id + "&type=font";
|
id + "&type=font";
|
||||||
let expected = url_prefix +
|
let expected = url_prefix +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
|
||||||
id + "&type=font";
|
id + "&type=font";
|
||||||
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
let processingInstruction =
|
let processingInstruction =
|
||||||
document.createProcessingInstruction(
|
document.createProcessingInstruction(
|
||||||
"xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");
|
"xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, font_url,
|
queryXhr(font_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, expected);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, expected);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
document.insertBefore(processingInstruction, document.firstChild);
|
||||||
}),
|
}, "Font from external stylesheet (from ProcessingInstruction).");
|
||||||
1000);
|
|
||||||
document.insertBefore(processingInstruction, document.firstChild);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -17,35 +17,33 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from imported stylesheet (external).");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
||||||
"&import-rule" + "&type=image";
|
"&import-rule" + "&type=image";
|
||||||
var url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
|
var url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
|
||||||
var css_referrer = url_prefix +
|
var css_referrer = url_prefix +
|
||||||
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id +
|
||||||
"&type=image";
|
"&type=image";
|
||||||
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
var link = document.createElement("link");
|
var link = document.createElement("link");
|
||||||
link.href = css_url;
|
link.href = css_url;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.onload = function() {
|
link.onload = function() {
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_referrer);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_referrer);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
};
|
||||||
}),
|
document.head.appendChild(link);
|
||||||
1000);
|
}, "Image from imported stylesheet (external).");
|
||||||
};
|
|
||||||
document.head.appendChild(link);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,30 +16,28 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from external stylesheet.");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
|
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
|
||||||
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
var link = document.createElement("link");
|
var link = document.createElement("link");
|
||||||
link.href = css_url;
|
link.href = css_url;
|
||||||
link.rel = "stylesheet";
|
link.rel = "stylesheet";
|
||||||
link.onload = function() {
|
link.onload = css_test.step_func(function() {
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
});
|
||||||
}),
|
document.head.appendChild(link);
|
||||||
1000);
|
}, "Image from external stylesheet.");
|
||||||
};
|
|
||||||
document.head.appendChild(link);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,25 +16,23 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from inline styles.");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
||||||
var img_url = css_url + "&report-headers";
|
var img_url = css_url + "&report-headers";
|
||||||
|
|
||||||
var div = document.querySelector("div.styled");
|
var div = document.querySelector("div.styled");
|
||||||
div.style = "content:url(" + css_url + ")";
|
div.style = "content:url(" + css_url + ")";
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, location.origin + "/");
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, location.origin + "/");
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Image from inline styles.");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -17,28 +17,26 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from imported stylesheet (internal).");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/";
|
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/";
|
||||||
var css_url = url_prefix + "stylesheet.py?id=" + id;
|
var css_url = url_prefix + "stylesheet.py?id=" + id;
|
||||||
var img_url = url_prefix + "image.py?report-headers&id=" + id;
|
var img_url = url_prefix + "image.py?report-headers&id=" + id;
|
||||||
|
|
||||||
var style = document.createElement("style");
|
var style = document.createElement("style");
|
||||||
style.type = 'text/css';
|
style.type = 'text/css';
|
||||||
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
|
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Image from imported stylesheet (internal).");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -16,27 +16,25 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from internal stylesheet.");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
||||||
var img_url = css_url + "&report-headers";
|
var img_url = css_url + "&report-headers";
|
||||||
|
|
||||||
var style = document.createElement("style");
|
var style = document.createElement("style");
|
||||||
style.type = 'text/css';
|
style.type = 'text/css';
|
||||||
style.appendChild(document.createTextNode("div.styled::before { content:url(" + css_url + ")}"));
|
style.appendChild(document.createTextNode("div.styled::before { content:url(" + css_url + ")}"));
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, location.origin + "/");
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, location.origin + "/");
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Image from internal stylesheet.");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -14,24 +14,22 @@
|
||||||
the referrer and referrer policy from the document.</p>
|
the referrer and referrer policy from the document.</p>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from presentation attributes.");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id;
|
||||||
var img_url = css_url + "&report-headers";
|
var img_url = css_url + "&report-headers";
|
||||||
|
|
||||||
document.body.background = css_url;
|
document.body.background = css_url;
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, location.origin + "/");
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, location.origin + "/");
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
}, "Image from presentation attributes.");
|
||||||
}),
|
</script>
|
||||||
1000);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -17,26 +17,24 @@
|
||||||
<div class="styled"></div>
|
<div class="styled"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var css_test = async_test("Image from external stylesheet (from ProcessingInstruction).");
|
async_test(function(css_test) {
|
||||||
var id = token();
|
var id = token();
|
||||||
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
|
||||||
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
|
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id;
|
||||||
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" +
|
||||||
"?id=" + id + "&report-headers";
|
"?id=" + id + "&report-headers";
|
||||||
|
|
||||||
var processingInstruction = document.createProcessingInstruction("xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");
|
var processingInstruction = document.createProcessingInstruction("xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");
|
||||||
css_test.step_timeout(
|
css_test.step_timeout(function() {
|
||||||
queryXhr.bind(this, img_url,
|
queryXhr(img_url, function(message) {
|
||||||
function(message) {
|
assert_own_property(message, "headers");
|
||||||
css_test.step(function() {
|
assert_own_property(message, "referrer");
|
||||||
assert_own_property(message, "headers");
|
assert_equals(message.referrer, css_url);
|
||||||
assert_own_property(message, "referrer");
|
css_test.done();
|
||||||
assert_equals(message.referrer, css_url);
|
}, null, null, css_test);
|
||||||
});
|
}, 1000);
|
||||||
css_test.done();
|
document.insertBefore(processingInstruction, document.firstChild);
|
||||||
}),
|
}, "Image from external stylesheet (from ProcessingInstruction).");
|
||||||
1000);
|
|
||||||
document.insertBefore(processingInstruction, document.firstChild);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -99,15 +99,15 @@ function wrapResult(url, server_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryIframe(url, callback, referrer_policy) {
|
function queryIframe(url, callback, attributes, referrer_policy, test) {
|
||||||
var iframe = appendIframeToBody(url, referrer_policy);
|
var iframe = appendIframeToBody(url, attributes);
|
||||||
var listener = function(event) {
|
var listener = test.step_func(function(event) {
|
||||||
if (event.source != iframe.contentWindow)
|
if (event.source != iframe.contentWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
callback(event.data, url);
|
callback(event.data, url);
|
||||||
window.removeEventListener("message", listener);
|
window.removeEventListener("message", listener);
|
||||||
}
|
});
|
||||||
window.addEventListener("message", listener);
|
window.addEventListener("message", listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,12 +122,12 @@ function queryImage(url, callback, attributes, referrerPolicy, test) {
|
||||||
var noSrcDocPolicy = new Promise((resolve, reject) => {
|
var noSrcDocPolicy = new Promise((resolve, reject) => {
|
||||||
var iframeWithoutOwnPolicy = document.createElement('iframe');
|
var iframeWithoutOwnPolicy = document.createElement('iframe');
|
||||||
iframeWithoutOwnPolicy.srcdoc = "Hello, world.";
|
iframeWithoutOwnPolicy.srcdoc = "Hello, world.";
|
||||||
iframeWithoutOwnPolicy.onload = function () {
|
iframeWithoutOwnPolicy.onload = test.step_func(function () {
|
||||||
var nextUrl = url + "&cache_destroyer2=" + (new Date()).getTime();
|
var nextUrl = url + "&cache_destroyer2=" + (new Date()).getTime();
|
||||||
loadImageInWindow(nextUrl, function (img) {
|
loadImageInWindow(nextUrl, test.step_func(function (img) {
|
||||||
resolve(decodeImageData(extractImageData(img)));
|
resolve(decodeImageData(extractImageData(img)));
|
||||||
}, attributes, iframeWithoutOwnPolicy.contentWindow);
|
}), attributes, iframeWithoutOwnPolicy.contentWindow);
|
||||||
};
|
});
|
||||||
document.body.appendChild(iframeWithoutOwnPolicy);
|
document.body.appendChild(iframeWithoutOwnPolicy);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -137,19 +137,19 @@ function queryImage(url, callback, attributes, referrerPolicy, test) {
|
||||||
var iframeWithOwnPolicy = document.createElement('iframe');
|
var iframeWithOwnPolicy = document.createElement('iframe');
|
||||||
iframeWithOwnPolicy.srcdoc = "<meta name='referrer' content='" + iframePolicy + "'>Hello world.";
|
iframeWithOwnPolicy.srcdoc = "<meta name='referrer' content='" + iframePolicy + "'>Hello world.";
|
||||||
|
|
||||||
iframeWithOwnPolicy.onload = function () {
|
iframeWithOwnPolicy.onload = test.step_func(function () {
|
||||||
var nextUrl = url + "&cache_destroyer3=" + (new Date()).getTime();
|
var nextUrl = url + "&cache_destroyer3=" + (new Date()).getTime();
|
||||||
loadImageInWindow(nextUrl, function (img) {
|
loadImageInWindow(nextUrl, test.step_func(function (img) {
|
||||||
resolve(decodeImageData(extractImageData(img)));
|
resolve(decodeImageData(extractImageData(img)));
|
||||||
}, null, iframeWithOwnPolicy.contentWindow);
|
}), null, iframeWithOwnPolicy.contentWindow);
|
||||||
};
|
});
|
||||||
document.body.appendChild(iframeWithOwnPolicy);
|
document.body.appendChild(iframeWithOwnPolicy);
|
||||||
});
|
});
|
||||||
|
|
||||||
var pagePolicy = new Promise((resolve, reject) => {
|
var pagePolicy = new Promise((resolve, reject) => {
|
||||||
loadImageInWindow(url, function (img) {
|
loadImageInWindow(url, test.step_func(function (img) {
|
||||||
resolve(decodeImageData(extractImageData(img)));
|
resolve(decodeImageData(extractImageData(img)));
|
||||||
}, attributes, window);
|
}), attributes, window);
|
||||||
});
|
});
|
||||||
|
|
||||||
Promise.all([noSrcDocPolicy, srcDocPolicy, pagePolicy]).then(test.step_func(values => {
|
Promise.all([noSrcDocPolicy, srcDocPolicy, pagePolicy]).then(test.step_func(values => {
|
||||||
|
@ -159,52 +159,52 @@ function queryImage(url, callback, attributes, referrerPolicy, test) {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryXhr(url, callback) {
|
function queryXhr(url, callback, attributes, referrer_policy, test) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url, true);
|
xhr.open('GET', url, true);
|
||||||
xhr.onreadystatechange = function(e) {
|
xhr.onreadystatechange = test.step_func(function(e) {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||||
var server_data = JSON.parse(this.responseText);
|
var server_data = JSON.parse(xhr.responseText);
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryWorker(url, callback) {
|
function queryWorker(url, callback, attributes, referrer_policy, test) {
|
||||||
var worker = new Worker(url);
|
var worker = new Worker(url);
|
||||||
worker.onmessage = function(event) {
|
worker.onmessage = test.step_func(function(event) {
|
||||||
var server_data = event.data;
|
var server_data = event.data;
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryModuleWorkerTopLevel(url, callback) {
|
function queryModuleWorkerTopLevel(url, callback, attributes, referrer_policy, test) {
|
||||||
var worker = new Worker(url, {type: "module"});
|
var worker = new Worker(url, {type: "module"});
|
||||||
worker.onmessage = function(event) {
|
worker.onmessage = test.step_func(function(event) {
|
||||||
var server_data = event.data;
|
var server_data = event.data;
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function querySharedWorker(url, callback) {
|
function querySharedWorker(url, callback, attributes, referrer_policy, test) {
|
||||||
var worker = new SharedWorker(url);
|
var worker = new SharedWorker(url);
|
||||||
worker.port.onmessage = function(event) {
|
worker.port.onmessage = test.step_func(function(event) {
|
||||||
var server_data = event.data;
|
var server_data = event.data;
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryFetch(url, callback) {
|
function queryFetch(url, callback, attributes, referrer_policy, test) {
|
||||||
fetch(url).then(function(response) {
|
fetch(url).then(test.step_func(function(response) {
|
||||||
response.json().then(function(server_data) {
|
response.json().then(test.step_func(function(server_data) {
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
});
|
}));
|
||||||
}
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryNavigable(element, url, callback, attributes) {
|
function queryNavigable(element, url, callback, attributes, test) {
|
||||||
var navigable = element
|
var navigable = element
|
||||||
navigable.href = url;
|
navigable.href = url;
|
||||||
navigable.target = "helper-iframe";
|
navigable.target = "helper-iframe";
|
||||||
|
@ -220,42 +220,41 @@ function queryNavigable(element, url, callback, attributes) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var listener = function(event) {
|
var listener = test.step_func(function(event) {
|
||||||
if (event.source != helperIframe.contentWindow)
|
if (event.source != helperIframe.contentWindow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
callback(event.data, url);
|
callback(event.data, url);
|
||||||
window.removeEventListener("message", listener);
|
window.removeEventListener("message", listener);
|
||||||
}
|
});
|
||||||
window.addEventListener("message", listener);
|
window.addEventListener("message", listener);
|
||||||
|
|
||||||
navigable.click();
|
navigable.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryLink(url, callback, referrer_policy) {
|
function queryLink(url, callback, attributes, referrer_policy, test) {
|
||||||
var a = document.createElement("a");
|
var a = document.createElement("a");
|
||||||
a.innerHTML = "Link to subresource";
|
a.innerHTML = "Link to subresource";
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
queryNavigable(a, url, callback, referrer_policy)
|
queryNavigable(a, url, callback, attributes, test)
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryAreaLink(url, callback, referrer_policy) {
|
function queryAreaLink(url, callback, attributes, referrer_policy, test) {
|
||||||
var area = document.createElement("area");
|
var area = document.createElement("area");
|
||||||
// TODO(kristijanburnik): Append to map and add image.
|
// TODO(kristijanburnik): Append to map and add image.
|
||||||
document.body.appendChild(area);
|
document.body.appendChild(area);
|
||||||
queryNavigable(area, url, callback, referrer_policy)
|
queryNavigable(area, url, callback, attributes, test)
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryScript(url, callback, attributes, referrer_policy) {
|
function queryScript(url, callback, attributes, referrer_policy, test) {
|
||||||
var script = document.createElement("script");
|
var script = document.createElement("script");
|
||||||
script.src = url;
|
script.src = url;
|
||||||
script.referrerPolicy = referrer_policy;
|
script.referrerPolicy = referrer_policy;
|
||||||
|
|
||||||
var listener = function(event) {
|
var listener = test.step_func(function(event) {
|
||||||
var server_data = event.data;
|
var server_data = event.data;
|
||||||
callback(wrapResult(url, server_data), url);
|
callback(wrapResult(url, server_data), url);
|
||||||
window.removeEventListener("message", listener);
|
window.removeEventListener("message", listener);
|
||||||
}
|
});
|
||||||
window.addEventListener("message", listener);
|
window.addEventListener("message", listener);
|
||||||
|
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
|
|
|
@ -96,31 +96,31 @@ function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) {
|
||||||
},
|
},
|
||||||
|
|
||||||
start: function() {
|
start: function() {
|
||||||
t._constructSubresourceUrl();
|
async_test(function(test) {
|
||||||
t._constructExpectedReferrerUrl();
|
|
||||||
|
|
||||||
var test = async_test(t._testDescription);
|
t._constructSubresourceUrl();
|
||||||
|
t._constructExpectedReferrerUrl();
|
||||||
|
|
||||||
t._invokeSubresource(function(result) {
|
t._invokeSubresource(test.step_func(function(result) {
|
||||||
// Check if the result is in valid format. NOOP in release.
|
// Check if the result is in valid format. NOOP in release.
|
||||||
sanityChecker.checkSubresourceResult(
|
sanityChecker.checkSubresourceResult(
|
||||||
test, t._scenario, t._subresourceUrl, result);
|
test, t._scenario, t._subresourceUrl, result);
|
||||||
|
|
||||||
// Check the reported URL.
|
// Check the reported URL.
|
||||||
test.step(function() {
|
test.step(function() {
|
||||||
assert_equals(result.referrer,
|
assert_equals(result.referrer,
|
||||||
t._expectedReferrerUrl,
|
t._expectedReferrerUrl,
|
||||||
"Reported Referrer URL is '" +
|
"Reported Referrer URL is '" +
|
||||||
t._scenario.referrer_url + "'.");
|
t._scenario.referrer_url + "'.");
|
||||||
assert_equals(result.headers.referer,
|
assert_equals(result.headers.referer,
|
||||||
t._expectedReferrerUrl,
|
t._expectedReferrerUrl,
|
||||||
"Reported Referrer URL from HTTP header is '" +
|
"Reported Referrer URL from HTTP header is '" +
|
||||||
t._expectedReferrerUrl + "'");
|
t._expectedReferrerUrl + "'");
|
||||||
}, "Reported Referrer URL is as expected: " + t._scenario.referrer_url);
|
}, "Reported Referrer URL is as expected: " + t._scenario.referrer_url);
|
||||||
|
|
||||||
test.done();
|
|
||||||
}, test);
|
|
||||||
|
|
||||||
|
test.done();
|
||||||
|
}), test);
|
||||||
|
}, t._testDescription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,26 +13,28 @@
|
||||||
<h1>Referrer Policy: A document with an opaque origin doesn't send referrers</h1>
|
<h1>Referrer Policy: A document with an opaque origin doesn't send referrers</h1>
|
||||||
<script>
|
<script>
|
||||||
function testSandboxedIframe(description, sandboxAttributes, expectedReferrer) {
|
function testSandboxedIframe(description, sandboxAttributes, expectedReferrer) {
|
||||||
var test = async_test(description);
|
async_test(function(test) {
|
||||||
window.addEventListener("message", test.step_func((msg) => {
|
window.addEventListener("message", test.step_func((msg) => {
|
||||||
if (msg.data.description === description) {
|
if (msg.data.description === description) {
|
||||||
assert_equals(msg.data.referrer, expectedReferrer);
|
assert_equals(msg.data.referrer, expectedReferrer);
|
||||||
test.done();
|
test.done();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var iframe = document.createElement("iframe");
|
var iframe = document.createElement("iframe");
|
||||||
iframe.sandbox = sandboxAttributes;
|
iframe.sandbox = sandboxAttributes;
|
||||||
iframe.srcdoc = `
|
iframe.srcdoc = `
|
||||||
<meta name = "referrer" content = "always">
|
<meta name = "referrer" content = "always">
|
||||||
<script src = "/referrer-policy/generic/common.js"></` + `script>
|
<script src = "/referrer-policy/generic/common.js"></` + `script>
|
||||||
<script>
|
<script>
|
||||||
var urlPath = "/referrer-policy/generic/subresource/xhr.py";
|
var urlPath = "/referrer-policy/generic/subresource/xhr.py";
|
||||||
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
|
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
|
||||||
queryXhr(url, (msg) => {
|
queryXhr(url, (msg) => {
|
||||||
parent.postMessage({referrer: msg.referrer, description: "${description}"}, "*")});
|
parent.postMessage({referrer: msg.referrer, description: "${description}"}, "*")
|
||||||
</` + "script>";
|
}, null, null, test);
|
||||||
document.body.appendChild(iframe);
|
</` + "script>";
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
}, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
testSandboxedIframe("Sandboxed iframe with opaque origin doesn't send referrers.", "allow-scripts", undefined);
|
testSandboxedIframe("Sandboxed iframe with opaque origin doesn't send referrers.", "allow-scripts", undefined);
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Area is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryAreaLink(url, function(message) {
|
queryAreaLink(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "Area is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -24,22 +24,21 @@
|
||||||
if (!window.fetch)
|
if (!window.fetch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var fetch_test = async_test("Fetch is responding with HTTP headers");
|
async_test(function(fetch_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
|
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
|
||||||
var url = location.protocol + "//" + location.hostname + ":" +
|
var url = location.protocol + "//" + location.hostname + ":" +
|
||||||
location.port + urlPath;
|
location.port + urlPath;
|
||||||
queryFetch(url, function(message) {
|
queryFetch(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n";
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n";
|
||||||
fetch_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
fetch_test.done();
|
||||||
fetch_test.done();
|
}, null, null, fetch_test);
|
||||||
});
|
}, "Fetch is responding with HTTP headers");
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Iframe is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryIframe(url, function(message) {
|
queryIframe(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "Iframe is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Image is encoding headers as JSON.");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/image.py';
|
var urlPath = '/referrer-policy/generic/subresource/image.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath + "?cache_destroyer=" + (new Date()).getTime();
|
urlPath + "?cache_destroyer=" + (new Date()).getTime();
|
||||||
queryImage(url, function(message) {
|
queryImage(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, "always", messaging_test);
|
||||||
}, null, "always", messaging_test);
|
}, "Image is encoding headers as JSON.");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Link is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
var urlPath = '/referrer-policy/generic/subresource/document.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryLink(url, function(message) {
|
queryLink(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "Link is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Script is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/script.py';
|
var urlPath = '/referrer-policy/generic/subresource/script.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryScript(url, function(message) {
|
queryScript(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "Script is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("Worker is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/worker.py';
|
var urlPath = '/referrer-policy/generic/subresource/worker.py';
|
||||||
var url = location.protocol + "//" + location.hostname + ":" +
|
var url = location.protocol + "//" + location.hostname + ":" +
|
||||||
location.port + urlPath;
|
location.port + urlPath;
|
||||||
queryWorker(url, function(message) {
|
queryWorker(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "Worker is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var messaging_test = async_test("XHR is responding with HTTP headers");
|
async_test(function(messaging_test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
|
var urlPath = '/referrer-policy/generic/subresource/xhr.py';
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryXhr(url, function(message) {
|
queryXhr(url, function(message) {
|
||||||
var pre = document.getElementById('received_message')
|
var pre = document.getElementById('received_message')
|
||||||
var headers = message.headers;
|
var headers = message.headers;
|
||||||
pre.innerHTML = "";
|
pre.innerHTML = "";
|
||||||
pre.innerHTML += url + ":\n\n";
|
pre.innerHTML += url + ":\n\n";
|
||||||
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
|
||||||
messaging_test.step(function() {
|
|
||||||
assert_own_property(headers, "host")
|
assert_own_property(headers, "host")
|
||||||
assert_own_property(headers, "connection")
|
assert_own_property(headers, "connection")
|
||||||
});
|
messaging_test.done();
|
||||||
messaging_test.done();
|
}, null, null, messaging_test);
|
||||||
});
|
}, "XHR is responding with HTTP headers");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
|
@ -15,14 +15,15 @@
|
||||||
<pre id="received_message">Running...</pre>
|
<pre id="received_message">Running...</pre>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var test = async_test("Image has a referrer despite CSP 'referrer' directive");
|
async_test(function(test) {
|
||||||
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
|
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
|
||||||
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
|
||||||
urlPath;
|
urlPath;
|
||||||
queryImage(url, test.step_func(function(message) {
|
queryImage(url, function(message) {
|
||||||
assert_equals(message.referrer, document.location.href);
|
assert_equals(message.referrer, document.location.href);
|
||||||
test.done();
|
test.done();
|
||||||
}), null, 'always', test);
|
}, null, 'always', test);
|
||||||
|
}, "Image has a referrer despite CSP 'referrer' directive");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="log"></div>
|
<div id="log"></div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue