Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement source for postMessage events #22514

Merged
merged 7 commits into from Jan 8, 2019
Next

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

  • Loading branch information
jdm committed Jan 7, 2019
commit 3cd6df1ef97fe152d9b6bbeb7a2d107b4e15b727
"support"
],
"referrer-policy/css-integration/child-css/external-import-stylesheet.html": [
"a2d3e8ced0412b97422847d4d81c1403cf9ae52c",
"40f4234ad48d19162cefae933fd0f53a72ff0c19",
"testharness"
],
"referrer-policy/css-integration/child-css/internal-import-stylesheet.html": [
"aebf5031484b799989d6b6a9dd72a5bc28575214",
"30c5ea2903094af38dea9a7a565255d178069178",
"testharness"
],
"referrer-policy/css-integration/child-css/processing-instruction.html": [
"b6333e2c7b248c3f3b863bd06f1c99abd472f162",
"52a0ded42a185ed5ff6f449879e0ce50f8255868",
"testharness"
],
"referrer-policy/css-integration/css-test-helper.js": [
"f5886dbbcbe358438dfbac45c5a0127e9e990ad4",
"788df16a456b83a23de662b710c200042a1e7254",
"support"
],
"referrer-policy/css-integration/font-face/external-import-stylesheet.html": [
"c344c56c5bf322f35e8d8c74427d80391e6637d3",
"80e3587ad62f040f2cfb28645437fcbc0e66b415",
"testharness"
],
"referrer-policy/css-integration/font-face/external-stylesheet.html": [
"24e4bb99900a556cb0b44144a25c9f8249224eb7",
"a91eb3fe758299229040466deb2d1b0263f77197",
"testharness"
],
"referrer-policy/css-integration/font-face/internal-import-stylesheet.html": [
"54e2383423cab8679635d05c256c32e27a94c024",
"a637082a4ce7dff612b223fc8a4c2195db300013",
"testharness"
],
"referrer-policy/css-integration/font-face/internal-stylesheet.html": [
"b3869bcebdcdadea3e50d7e8713c853d46ba4816",
"eebd864bc56725b79c1f29c0597466574e2af091",
"testharness"
],
"referrer-policy/css-integration/font-face/processing-instruction.html": [
"89ee918e24e14b8ea5d35a7dfaf09610eb89ee11",
"bfc42d9fcbe355514c7bf72ac087d7159439824e",
"testharness"
],
"referrer-policy/css-integration/image/external-import-stylesheet.html": [
"0023af31b17ee883e6e9fe6cdd8f09b8eacf83d1",
"80c71b0e215b547d664aee8757d70188c012a9c0",
"testharness"
],
"referrer-policy/css-integration/image/external-stylesheet.html": [
"d14769db4a1221bb6e220aa594c4a3b6bab97aa1",
"ba7497b97de6911c149b423bf25305123e97150e",
"testharness"
],
"referrer-policy/css-integration/image/inline-style.html": [
"42128ae062093c0e8feb5d90ab62a6cb281cf8e9",
"758b6d91852f67d4e47726815804a5e366fe534d",
"testharness"
],
"referrer-policy/css-integration/image/internal-import-stylesheet.html": [
"90003547f4d4e2048cc33f7125d756d42507140d",
"24aa1858304a2130624589b0a64c6f9ec9cac5a1",
"testharness"
],
"referrer-policy/css-integration/image/internal-stylesheet.html": [
"943108d66e4b273a6d3be30b2ea8a0edb0490c7b",
"f4567885e1f1e215487a11f1023d117517cd88b8",
"testharness"
],
"referrer-policy/css-integration/image/presentation-attribute.html": [
"78401d3ec16866f1e51618bdb5cb028f5eea8490",
"d0a4d96f84c8e48ea5daf5699c7b04bbc877ba86",
"testharness"
],
"referrer-policy/css-integration/image/processing-instruction.html": [
"1ca18547dd54c4707250f400999a041f16f77ddf",
"926147be489a85164758dcf644c715e4a5c02de6",
"testharness"
],
"referrer-policy/css-integration/svg/external-stylesheet.html": [
"testharness"
],
"referrer-policy/generic/common.js": [
"f9bbe42b914c46822ec8b74aacd849789723dd72",
"a16691bccb2543ad68b81e9a16fa261d3cce6a9f",
"support"
],
"referrer-policy/generic/iframe-inheritance.html": [
"support"
],
"referrer-policy/generic/referrer-policy-test-case.js": [
"4641683cd850da86279dcd062aaf868d346aa2bd",
"2385cc2a1c4e51a2855299e42b69ac12362cd699",
"support"
],
"referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html": [
"8fee77f836378ec137c3bf0d554f4def83a5caba",
"1b2b12bf6910e075338462de577dc4228f52a21f",
"testharness"
],
"referrer-policy/generic/sanity-checker.js": [
"e0714885ffcc9d13bf2acb8e60634a2dd62170dc",
"support"
],
"referrer-policy/generic/subresource-test/area-navigate.html": [
"bca7e479fa2ca41505bc73cf74c6e518efa7e947",
"3eb824521b7801c518a7b36218075eb3d74bd639",
"testharness"
],
"referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html": [
"bfdf1166ce7876c478b4cfcf9dab439d04a7e437",
"testharness"
],
"referrer-policy/generic/subresource-test/fetch-messaging.html": [
"046b29e9a3e94753c1a552732b0f44d2883a011d",
"edb159d9eb1cf5eed6af249a40f70d9ecd079d68",
"testharness"
],
"referrer-policy/generic/subresource-test/iframe-messaging.html": [
"a3e55707c26f95624baaa54b8778d641cd756d72",
"606e18b281f6c3498573dc9bfaefefca1390026a",
"testharness"
],
"referrer-policy/generic/subresource-test/image-decoding.html": [
"448f12b1348fa77aaaebd52b2c3ee6ae9c73a5f6",
"9c50ea6619389dad8ad81c4c2afbeb8030b176db",
"testharness"
],
"referrer-policy/generic/subresource-test/link-navigate.html": [
"45e502004d4b640d0b2194e48d060b8d3cc3f120",
"95582f65bac8a3b478cc8cd4fe9b883fb507237f",
"testharness"
],
"referrer-policy/generic/subresource-test/script-messaging.html": [
"09c5db6193fed52c60edc2526609c3d501c45da8",
"f73f4406df20694480f82570ed8674fe283ea375",
"testharness"
],
"referrer-policy/generic/subresource-test/worker-messaging.html": [
"6d34366b943ad2b3b15f08179a58ef5227c675d0",
"fd7591882e91e7265fd740b9018248d21f13b5b9",
"testharness"
],
"referrer-policy/generic/subresource-test/xhr-messaging.html": [
"09f69140098a16bd66a117cf6187fedc862d9233",
"6ef4a9cfd4b98c3562fe7ef6e04eb931073166de",
"testharness"
],
"referrer-policy/generic/subresource/__init__.py": [
"support"
],
"referrer-policy/generic/unsupported-csp-referrer-directive.html": [
"9627d16559903b5202f842f3c3355a2e7005f65c",
"475efa55091778e747fa36030f7b422b89d6d4b9",
"testharness"
],
"referrer-policy/no-referrer-when-downgrade/attr-referrer/cross-origin/http-http/a-tag/no-redirect/insecure-protocol.http.html": [

This file was deleted.

@@ -16,31 +16,29 @@
<div class="styled"></div>

<script>
let css_test = async_test("Child css from external stylesheet.");
let id = token();
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" + "&referrer-policy=no-referrer";
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
"?id=" + id + "&report-headers";
async_test(function(css_test) {
let id = token();
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" + "&referrer-policy=no-referrer";
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
"?id=" + id + "&report-headers";

let link = document.createElement("link");
link.href = css_url;
link.rel = "stylesheet";
link.onload = function() {
css_test.step_timeout(
queryXhr.bind(this, check_url,
function(message) {
css_test.step(function() {
assert_own_property(message, "headers");
assert_equals(message.referrer, undefined);
});
css_test.done();
}),
1000);
};
document.head.appendChild(link);
let link = document.createElement("link");
link.href = css_url;
link.rel = "stylesheet";
link.onload = function() {
css_test.step_timeout(function() {
queryXhr(check_url, function(message) {
assert_own_property(message, "headers");
assert_equals(message.referrer, undefined);
css_test.done();
}, null, null, css_test);
}, 1000);
};
document.head.appendChild(link);
}, "Child css from external stylesheet.");
</script>

<div id="log"></div>
@@ -16,28 +16,26 @@
<div class="styled"></div>

<script>
let css_test = async_test("Child css from internal stylesheet.");
let id = token();
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 check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
"?id=" + id + "&report-headers";
async_test(function(css_test) {
let id = token();
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 check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" +
"?id=" + id + "&report-headers";

let style = document.createElement("style");
style.type = 'text/css';
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
document.head.appendChild(style);
css_test.step_timeout(
queryXhr.bind(this, check_url,
function(message) {
css_test.step(function() {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_url);
});
css_test.done();
}),
1000);
let style = document.createElement("style");
style.type = 'text/css';
style.appendChild(document.createTextNode("@import url('" + css_url + "');"));
document.head.appendChild(style);
css_test.step_timeout(function() {
queryXhr(check_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, css_url);
css_test.done();
}, null, null, css_test);
}, 1000);
}, "Child css from internal stylesheet.");
</script>

<div id="log"></div>
@@ -15,31 +15,29 @@
<div class="styled"></div>

<script>
let css_test = async_test("Child css via a ProcessingInstruction.");
let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
id;
let css_url = url_prefix + "&amp;import-rule";
let expected = url_prefix + "&import-rule";
let check_url = url_prefix + "&report-headers";
async_test(function(css_test) {
let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" +
id;
let css_url = url_prefix + "&amp;import-rule";
let expected = url_prefix + "&import-rule";
let check_url = url_prefix + "&report-headers";

let processingInstruction =
document.createProcessingInstruction(
"xml-stylesheet", "href=\"" +css_url + "\" type=\"text/css\"");
css_test.step_timeout(
queryXhr.bind(this, check_url,
function(message) {
css_test.step(function() {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, expected);
});
css_test.done();
}),
1000);
document.insertBefore(processingInstruction, document.firstChild);
let processingInstruction =
document.createProcessingInstruction(
"xml-stylesheet", "href=\"" +css_url + "\" type=\"text/css\"");
css_test.step_timeout(function() {
queryXhr(check_url, function(message) {
assert_own_property(message, "headers");
assert_own_property(message, "referrer");
assert_equals(message.referrer, expected);
css_test.done();
}, null, null, css_test);
}, 1000);
document.insertBefore(processingInstruction, document.firstChild);
}, "Child css via a ProcessingInstruction.");
</script>

<div id="log"></div>
@@ -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);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.