Bug 1340654 P2 Test that nested referrer policy from an importScripts() has no effect. r=baku
authorBen Kelly <ben@wanderview.com>
Thu, 23 Feb 2017 10:54:43 -0500
changeset 373632 b8ae4c3de32817cccc7d57bb28195de3254c021a
parent 373631 a02f3229c14c08ed7017e8c527d7a36cc03692a1
child 373633 88206a320746c25d87e509fda81950d89ccb2696
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1340654
milestone54.0a1
Bug 1340654 P2 Test that nested referrer policy from an importScripts() has no effect. r=baku
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/api/policies/nested-policy.js
testing/web-platform/tests/fetch/api/policies/nested-policy.js.headers
testing/web-platform/tests/fetch/api/policies/referrer-origin-when-cross-origin.js
testing/web-platform/tests/fetch/api/policies/referrer-origin.js
testing/web-platform/tests/fetch/api/policies/referrer-unsafe-url.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -43414,16 +43414,26 @@
      {}
     ]
    ],
    "fetch/api/policies/csp-blocked.js.headers": [
     [
      {}
     ]
    ],
+   "fetch/api/policies/nested-policy.js": [
+    [
+     {}
+    ]
+   ],
+   "fetch/api/policies/nested-policy.js.headers": [
+    [
+     {}
+    ]
+   ],
    "fetch/api/policies/referrer-no-referrer.html.headers": [
     [
      {}
     ]
    ],
    "fetch/api/policies/referrer-no-referrer.js": [
     [
      {}
@@ -163669,16 +163679,24 @@
   "fetch/api/policies/csp-blocked.js": [
    "b4f3a386ae796c6e494d1728c0887fdf5c96ea88",
    "support"
   ],
   "fetch/api/policies/csp-blocked.js.headers": [
    "94dc6f63015b0835eb2a8c1892636bafeb1dfee7",
    "support"
   ],
+  "fetch/api/policies/nested-policy.js": [
+   "57cfc2060102695b601209e4927861aaee377c4e",
+   "support"
+  ],
+  "fetch/api/policies/nested-policy.js.headers": [
+   "fab90d344cbb78bad6445288c418b87736a830ae",
+   "support"
+  ],
   "fetch/api/policies/referrer-no-referrer-worker.html": [
    "cc9274c1b182a487dbe945e6d8754a671d78e3c4",
    "testharness"
   ],
   "fetch/api/policies/referrer-no-referrer.html": [
    "e1ecb25e8294ad2a50cf079d0b164a6d3fa6d40f",
    "testharness"
   ],
@@ -163702,17 +163720,17 @@
    "eb46215635a3d26d20595533c24abdc79192264f",
    "testharness"
   ],
   "fetch/api/policies/referrer-origin-when-cross-origin.html.headers": [
    "ad4eae9b2a1368f4b251579b9a246177f1c5ebbc",
    "support"
   ],
   "fetch/api/policies/referrer-origin-when-cross-origin.js": [
-   "e750c643dda40176e230d39e38057d4d2bda4fcf",
+   "f6b25aad46ba48422fab737582e82179666b5233",
    "support"
   ],
   "fetch/api/policies/referrer-origin-when-cross-origin.js.headers": [
    "ad4eae9b2a1368f4b251579b9a246177f1c5ebbc",
    "support"
   ],
   "fetch/api/policies/referrer-origin-worker.html": [
    "66feccfd0f0f2e5f0a82d6e591e03621c593acc8",
@@ -163722,17 +163740,17 @@
    "0ab191b8e4c349d47569a8d7cfeebec89711a0cb",
    "testharness"
   ],
   "fetch/api/policies/referrer-origin.html.headers": [
    "56b5f91097bb278ebc69345c0b56c65eb16cc3db",
    "support"
   ],
   "fetch/api/policies/referrer-origin.js": [
-   "368af4830da8fcd341ffb513b8c6c2c2bcfab3d9",
+   "8d8b58a4d5046e55e6bd97289cf6e515614e9577",
    "support"
   ],
   "fetch/api/policies/referrer-origin.js.headers": [
    "56b5f91097bb278ebc69345c0b56c65eb16cc3db",
    "support"
   ],
   "fetch/api/policies/referrer-unsafe-url-worker.html": [
    "70e7ec27a61ee68fb419213be149816ed618ce24",
@@ -163742,17 +163760,17 @@
    "906c41a44364be3e1bff38982ab920d85a3a3fbd",
    "testharness"
   ],
   "fetch/api/policies/referrer-unsafe-url.html.headers": [
    "9aefc6a6198eaec591e432bb5454e1ebb22e58a1",
    "support"
   ],
   "fetch/api/policies/referrer-unsafe-url.js": [
-   "24d042ef4e85cccf3d178f701af5664c954deaf3",
+   "e1881c5f3f0a7d1705a5d2eb5d3381d8788374d8",
    "support"
   ],
   "fetch/api/policies/referrer-unsafe-url.js.headers": [
    "9aefc6a6198eaec591e432bb5454e1ebb22e58a1",
    "support"
   ],
   "fetch/api/redirect/redirect-count-worker.html": [
    "61f80dc021081bea6fee7ef6dda10498515308ad",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/policies/nested-policy.js
@@ -0,0 +1,1 @@
+// empty, but referrer-policy set on this file
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/policies/nested-policy.js.headers
@@ -0,0 +1,1 @@
+Referrer-Policy: no-referrer
--- a/testing/web-platform/tests/fetch/api/policies/referrer-origin-when-cross-origin.js
+++ b/testing/web-platform/tests/fetch/api/policies/referrer-origin-when-cross-origin.js
@@ -1,11 +1,15 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+
+  // A nested importScripts() with a referrer-policy should have no effect
+  // on overall worker policy.
+  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";
 
 promise_test(function(test) {
   return fetch(fetchedUrl).then(function(resp) {
     assert_equals(resp.status, 200, "HTTP status is 200");
--- a/testing/web-platform/tests/fetch/api/policies/referrer-origin.js
+++ b/testing/web-platform/tests/fetch/api/policies/referrer-origin.js
@@ -1,11 +1,15 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+
+  // A nested importScripts() with a referrer-policy should have no effect
+  // on overall worker policy.
+  importScripts("nested-policy.js");
 }
 
 var referrerOrigin = "http://{{host}}:{{ports[http][0]}}/";
 var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=referer";
 
 promise_test(function(test) {
   return fetch(fetchedUrl).then(function(resp) {
     assert_equals(resp.status, 200, "HTTP status is 200");
--- a/testing/web-platform/tests/fetch/api/policies/referrer-unsafe-url.js
+++ b/testing/web-platform/tests/fetch/api/policies/referrer-unsafe-url.js
@@ -1,11 +1,15 @@
 if (this.document === undefined) {
   importScripts("/resources/testharness.js");
   importScripts("../resources/utils.js");
+
+  // A nested importScripts() with a referrer-policy should have no effect
+  // on overall worker policy.
+  importScripts("nested-policy.js");
 }
 
 var referrerUrl = location.href;
 var fetchedUrl = RESOURCES_DIR + "inspect-headers.py?headers=referer";
 
 promise_test(function(test) {
   return fetch(fetchedUrl).then(function(resp) {
     assert_equals(resp.status, 200, "HTTP status is 200");