Bug 1340654 P3 Test referrer-policy in service workers. r=baku

This commit is contained in:
Ben Kelly 2017-02-23 10:54:43 -05:00
Родитель d84237257b
Коммит 1c05664e65
9 изменённых файлов: 124 добавлений и 8 удалений

Просмотреть файл

@ -87473,6 +87473,12 @@
{}
]
],
"fetch/api/policies/referrer-no-referrer-service-worker.https.html": [
[
"/fetch/api/policies/referrer-no-referrer-service-worker.https.html",
{}
]
],
"fetch/api/policies/referrer-no-referrer-worker.html": [
[
"/fetch/api/policies/referrer-no-referrer-worker.html",
@ -87485,6 +87491,18 @@
{}
]
],
"fetch/api/policies/referrer-origin-service-worker.https.html": [
[
"/fetch/api/policies/referrer-origin-service-worker.https.html",
{}
]
],
"fetch/api/policies/referrer-origin-when-cross-origin-service-worker.https.html": [
[
"/fetch/api/policies/referrer-origin-when-cross-origin-service-worker.https.html",
{}
]
],
"fetch/api/policies/referrer-origin-when-cross-origin-worker.html": [
[
"/fetch/api/policies/referrer-origin-when-cross-origin-worker.html",
@ -87509,6 +87527,12 @@
{}
]
],
"fetch/api/policies/referrer-unsafe-url-service-worker.https.html": [
[
"/fetch/api/policies/referrer-unsafe-url-service-worker.https.html",
{}
]
],
"fetch/api/policies/referrer-unsafe-url-worker.html": [
[
"/fetch/api/policies/referrer-unsafe-url-worker.html",
@ -163692,6 +163716,10 @@
"fab90d344cbb78bad6445288c418b87736a830ae",
"support"
],
"fetch/api/policies/referrer-no-referrer-service-worker.https.html": [
"274797274e05e467499b98179dd23a19a960a014",
"testharness"
],
"fetch/api/policies/referrer-no-referrer-worker.html": [
"cc9274c1b182a487dbe945e6d8754a671d78e3c4",
"testharness"
@ -163712,6 +163740,14 @@
"fab90d344cbb78bad6445288c418b87736a830ae",
"support"
],
"fetch/api/policies/referrer-origin-service-worker.https.html": [
"cf400b001e381251b0eaca8290e975dc27f6ff0f",
"testharness"
],
"fetch/api/policies/referrer-origin-when-cross-origin-service-worker.https.html": [
"c2d6e3abb2b4ec0342ac9c16c468adb8b03e0426",
"testharness"
],
"fetch/api/policies/referrer-origin-when-cross-origin-worker.html": [
"3242db3a9319923287f36987f6f14581c239ced2",
"testharness"
@ -163725,7 +163761,7 @@
"support"
],
"fetch/api/policies/referrer-origin-when-cross-origin.js": [
"f6b25aad46ba48422fab737582e82179666b5233",
"802ebd6d423099439a790c3db9b7ae37cbe5d9a0",
"support"
],
"fetch/api/policies/referrer-origin-when-cross-origin.js.headers": [
@ -163737,7 +163773,7 @@
"testharness"
],
"fetch/api/policies/referrer-origin.html": [
"0ab191b8e4c349d47569a8d7cfeebec89711a0cb",
"ae8bfdfb5b9ae86522378ec798908b7db442797d",
"testharness"
],
"fetch/api/policies/referrer-origin.html.headers": [
@ -163745,13 +163781,17 @@
"support"
],
"fetch/api/policies/referrer-origin.js": [
"8d8b58a4d5046e55e6bd97289cf6e515614e9577",
"e863bed9479b1b89cb0d8fae680e471ca66c757f",
"support"
],
"fetch/api/policies/referrer-origin.js.headers": [
"56b5f91097bb278ebc69345c0b56c65eb16cc3db",
"support"
],
"fetch/api/policies/referrer-unsafe-url-service-worker.https.html": [
"d2fa5c7813f57909228b51417df0267cd7ec0c20",
"testharness"
],
"fetch/api/policies/referrer-unsafe-url-worker.html": [
"70e7ec27a61ee68fb419213be149816ed618ce24",
"testharness"

Просмотреть файл

@ -0,0 +1,5 @@
[referrer-origin-service-worker.https.html]
type: testharness
[Cross-origin referrer is overridden by client origin]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1341223

Просмотреть файл

@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fetch in service worker: referrer with no-referrer policy</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
service_worker_test("referrer-no-referrer.js?pipe=sub");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fetch in service worker: referrer with no-referrer policy</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
service_worker_test("referrer-origin.js?pipe=sub");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,17 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fetch in service worker: referrer with origin-when-cross-origin policy</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
service_worker_test("referrer-origin-when-cross-origin.js?pipe=sub");
</script>
</body>
</html>

Просмотреть файл

@ -7,8 +7,8 @@ if (this.document === undefined) {
importScripts("nested-policy.js");
}
var referrerOrigin = "http://{{host}}:{{ports[http][0]}}/";
var fetchedUrl = "http://{{host}}:{{ports[http][1]}}" + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=referer";
var referrerOrigin = location.origin + '/';
var fetchedUrl = "https://{{domains[www]}}:{{ports[https][0]}}" + dirname(location.pathname) + RESOURCES_DIR + "inspect-headers.py?cors&headers=referer";
promise_test(function(test) {
return fetch(fetchedUrl).then(function(resp) {

Просмотреть файл

@ -13,4 +13,4 @@
<script src="../resources/utils.js"></script>
<script src="referrer-origin.js?pipe=sub"></script>
</body>
</html>
</html>

Просмотреть файл

@ -7,7 +7,7 @@ if (this.document === undefined) {
importScripts("nested-policy.js");
}
var referrerOrigin = "http://{{host}}:{{ports[http][0]}}/";
var referrerOrigin = self.location.origin + '/';
var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=referer";
promise_test(function(test) {
@ -19,7 +19,7 @@ promise_test(function(test) {
}, "Request's referrer is origin");
promise_test(function(test) {
var referrerUrl = "http://{{domains[www]}}:{{ports[http][0]}}/";
var referrerUrl = "https://{{domains[www]}}:{{ports[https][0]}}/";
return fetch(fetchedUrl, { "referrer": referrerUrl }).then(function(resp) {
assert_equals(resp.status, 200, "HTTP status is 200");
assert_equals(resp.type , "basic", "Response's type is basic");

Просмотреть файл

@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fetch in worker: referrer with unsafe-url policy</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
<meta name="help" href="https://fetch.spec.whatwg.org/#http-network-or-cache-fetch">
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
service_worker_test("referrer-unsafe-url.js?pipe=sub");
</script>
</body>
</html>