mirror of
https://github.com/servo/servo.git
synced 2025-07-10 08:53:41 +01:00
Remove forked referrer policy tests
This commit is contained in:
parent
43e21dc845
commit
e6b363df5b
1310 changed files with 0 additions and 58157 deletions
|
@ -3,8 +3,6 @@ skip: true
|
||||||
skip: false
|
skip: false
|
||||||
[mozilla]
|
[mozilla]
|
||||||
skip: false
|
skip: false
|
||||||
[referrer-policy]
|
|
||||||
skip: true
|
|
||||||
[_webgl]
|
[_webgl]
|
||||||
skip: false
|
skip: false
|
||||||
[2dcontext]
|
[2dcontext]
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1 +0,0 @@
|
||||||
@kristijanburnik
|
|
|
@ -1,245 +0,0 @@
|
||||||
# Referrer-Policy Web Platform Tests
|
|
||||||
|
|
||||||
The Referrer-Policy tests are designed for testing browser implementations and conformance to the [W3 Referrer-Policy Specification](http://w3c.github.io/webappsec/specs/referrer-policy/).
|
|
||||||
|
|
||||||
## Project structure
|
|
||||||
|
|
||||||
The project contains tools, templates and a seed (```spec.src.json```) for generating tests. The main assertion logic resides in JS files in the root of the ```./generic/``` directory.
|
|
||||||
|
|
||||||
This is the overview of the project structure:
|
|
||||||
|
|
||||||
```
|
|
||||||
.
|
|
||||||
└── generic
|
|
||||||
├── subresource - documents being served as sub-resources (python scripts)
|
|
||||||
├── subresource-test - sanity checking tests for resource invocation
|
|
||||||
├── template - the test files template used for generating the tests
|
|
||||||
└── tools - for generating and maintaining the test suite
|
|
||||||
└── (genereated_tests_for_a_specification_1)
|
|
||||||
└── (genereated_tests_for_a_specification_2)
|
|
||||||
└── ...
|
|
||||||
└── (genereated_tests_for_a_specification_N)
|
|
||||||
```
|
|
||||||
|
|
||||||
## The spec JSON
|
|
||||||
|
|
||||||
The ```spec.src.json``` defines all the test scenarios for the referrer policy.
|
|
||||||
|
|
||||||
Invoking ```./generic/tools/generate.py``` will parse the spec JSON and determine which tests to generate (or skip) while using templates.
|
|
||||||
|
|
||||||
|
|
||||||
The spec can be validated by running ```./generic/tools/spec_validator.py```. This is specially important when you're making changes to ```spec.src.json```. Make sure it's a valid JSON (no comments or trailing commas). The validator should be informative and very specific on any issues.
|
|
||||||
|
|
||||||
For details about the spec JSON, see **Overview of the spec JSON** below.
|
|
||||||
|
|
||||||
|
|
||||||
## Generating and running the tests
|
|
||||||
|
|
||||||
The repository already contains generated tests, so if you're making changes,
|
|
||||||
see the **Removing all generated tests** section below, on how to remove them before you start generating tests which include your changes.
|
|
||||||
|
|
||||||
Start from the command line:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
|
|
||||||
# Chdir into the tests directory.
|
|
||||||
cd ~/web-platform-tests/referrer-policy
|
|
||||||
|
|
||||||
# Generate the test resources.
|
|
||||||
./generic/tools/generate.py
|
|
||||||
|
|
||||||
# Add all generated tests to the repo.
|
|
||||||
git add * && git commit -m "Add generated tests"
|
|
||||||
|
|
||||||
# Regenerate the manifest.
|
|
||||||
../manifest
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Navigate to [http://web-platform.test:8000/tools/runner/index.html](http://web-platform.test:8000/tools/runner/index.html).
|
|
||||||
|
|
||||||
Run tests under path: ```/referrer-policy```.
|
|
||||||
|
|
||||||
Click start.
|
|
||||||
|
|
||||||
|
|
||||||
## Options for generating tests
|
|
||||||
|
|
||||||
The generator script ```./generic/tools/generate.py``` has two targets: ```release``` and ```debug```.
|
|
||||||
|
|
||||||
* Using **release** for the target will produce tests using a template for optimizing size and performance. The release template is intended for the official web-platform-tests and possibly other test suites. No sanity checking is done in release mode. Use this option whenever you're checking into web-platform-tests.
|
|
||||||
|
|
||||||
* When generating for ```debug```, the produced tests will contain more verbosity and sanity checks. Use this target to identify problems with the test suite when making changes locally. Make sure you don't check in tests generated with the debug target.
|
|
||||||
|
|
||||||
Note that **release** is the default target when invoking ```generate.py```.
|
|
||||||
|
|
||||||
|
|
||||||
## Removing all generated tests
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Chdir into the tests directory.
|
|
||||||
cd ~/web-platform-tests/referrer-policy
|
|
||||||
|
|
||||||
# Remove all generated tests.
|
|
||||||
./generic/tools/clean.py
|
|
||||||
|
|
||||||
# Remove all generated tests to the repo.
|
|
||||||
git add * && git commit -m "Remove generated tests"
|
|
||||||
|
|
||||||
# Regenerate the manifest.
|
|
||||||
../manifest
|
|
||||||
```
|
|
||||||
|
|
||||||
**Important:**
|
|
||||||
The ```./generic/tools/clean.py``` utility will only work if there is a valid ```spec.src.json``` and previously generated directories match the specification requirement names. So make sure you run ```clean.py``` before you alter the specification section of the spec JSON.
|
|
||||||
|
|
||||||
|
|
||||||
## Updating the tests
|
|
||||||
|
|
||||||
The main test logic lives in ```./generic/referrer-policy-test-case.js``` with helper functions defined in ```./generic/common.js``` so you should probably start there.
|
|
||||||
|
|
||||||
For updating the test suite you will most likely do **a subset** of the following:
|
|
||||||
|
|
||||||
* Add a new sub-resource python script to ```./generic/subresource/```,
|
|
||||||
and update the reference to it in ```spec.src.json```.
|
|
||||||
|
|
||||||
* Add a sanity check test for a sub-resource to ```./generic/subresource-test/```.
|
|
||||||
|
|
||||||
* Implement new or update existing assertions in ```./generic/referrer-policy-test-case.js```.
|
|
||||||
|
|
||||||
* Exclude or add some tests by updating ```spec.src.json``` test expansions.
|
|
||||||
|
|
||||||
* Update the template files living in ```./generic/template/```.
|
|
||||||
|
|
||||||
* Implement a new delivery method via HTTP headers or as part of the test template in ```./generic/tools/generate.py```
|
|
||||||
|
|
||||||
* Update the spec schema by editing ```spec.src.json``` while updating the
|
|
||||||
```./generic/tools/spec_validator.py``` and ```./generic/tools/generate.py```
|
|
||||||
and making sure both still work after the change (by running them).
|
|
||||||
|
|
||||||
* Regenerate the tests and MANIFEST.json
|
|
||||||
|
|
||||||
|
|
||||||
## Updating the spec and regenerating
|
|
||||||
|
|
||||||
When updating the ```spec.src.json```, e.g. by adding a test expansion pattern to the ```excluded_tests``` section or when removing an expansion in the ```specification``` section, make sure to remove all previously generated files which would still get picked up by ```MANIFEST.json``` in the web-platform-tests root. As long as you don't change the specification requirements' names or remove them, you can easily regenerate the tests via command line:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
|
|
||||||
# Chdir into the tests directory.
|
|
||||||
cd ~/web-platform-tests/referrer-policy
|
|
||||||
|
|
||||||
# Regenerate the test resources.
|
|
||||||
./generic/tools/regenerate
|
|
||||||
|
|
||||||
# Add all the tests to the repo.
|
|
||||||
git add * && git commit -m "Update generated tests"
|
|
||||||
|
|
||||||
# Regenerate the manifest.
|
|
||||||
../manifest
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Overview of the spec JSON
|
|
||||||
|
|
||||||
**Main sections:**
|
|
||||||
|
|
||||||
* **specification**
|
|
||||||
|
|
||||||
Top level requirements with description fields and a ```test_expansion``` rule.
|
|
||||||
This is closely mimicking the [Referrer Policy specification](http://w3c.github.io/webappsec/specs/referrer-policy/) structure.
|
|
||||||
|
|
||||||
* **excluded_tests**
|
|
||||||
|
|
||||||
List of ```test_expansion``` patterns expanding into selections which get skipped when generating the tests (aka. blacklisting/suppressing)
|
|
||||||
|
|
||||||
* **referrer_policy_schema**
|
|
||||||
|
|
||||||
The schema to validate fields which define the ```referrer_policy``` elsewhere in the JSON.
|
|
||||||
A value for a referrer_policy can only be one specified in the referrer_policy_schema.
|
|
||||||
|
|
||||||
* **test_expansion_schema**
|
|
||||||
|
|
||||||
The schema used to check if a ```test_expansion``` is valid.
|
|
||||||
Each test expansion can only contain fields defined by this schema.
|
|
||||||
|
|
||||||
* **subresource_path**
|
|
||||||
|
|
||||||
A 1:1 mapping of a **subresource type** to the URL path of the sub-resource.
|
|
||||||
When adding a new sub-resource, a path to an existing file for it also must be specified.
|
|
||||||
|
|
||||||
|
|
||||||
### Test Expansion Patterns
|
|
||||||
|
|
||||||
Each field in a test expansion can be in one of the following formats:
|
|
||||||
|
|
||||||
* Single match: ```"value"```
|
|
||||||
|
|
||||||
* Match any of: ```["value1", "value2", ...]```
|
|
||||||
|
|
||||||
* Match all: ```"*"```
|
|
||||||
|
|
||||||
#### Example: test expansion in a requirement specification
|
|
||||||
|
|
||||||
The following example shows how to restrict the expansion of ```referrer_url``` to ```origin``` and allow rest of the arrangement to expand (permute) to all possible values. The name field will be the prefix of a generated HTML file name for the test.
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"name": "origin-only",
|
|
||||||
"title": "Referrer Policy is set to 'origin-only'",
|
|
||||||
"description": "Check that all sub-resources in all cases get only the origin portion of the referrer URL.",
|
|
||||||
"specification_url": "https://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-state-origin",
|
|
||||||
"referrer_policy": "origin",
|
|
||||||
"test_expansion": [
|
|
||||||
{
|
|
||||||
"name": "generic",
|
|
||||||
"expansion": "default",
|
|
||||||
"source_protocol": "*",
|
|
||||||
"target_protocol": "*",
|
|
||||||
"delivery_method": "*",
|
|
||||||
"redirection": "*",
|
|
||||||
"origin": "*",
|
|
||||||
"subresource": "*",
|
|
||||||
"referrer_url": "origin"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**NOTE:** An expansion is always constructive (inclusive), there isn't a negation operator for explicit exclusion. Be aware that using an empty list ```[]``` matches (expands into) exactly nothing. Tests which are to be excluded should be defined in the ```excluded_tests``` section instead.
|
|
||||||
|
|
||||||
A single test expansion pattern, be it a requirement or a suppressed pattern, gets expanded into a list of **selections** as follows:
|
|
||||||
|
|
||||||
* Expand each field's pattern (single, any of, or all) to list of allowed values (defined by the ```test_expansion_schema```)
|
|
||||||
|
|
||||||
* Permute - Recursively enumerate all **selections** accross all fields
|
|
||||||
|
|
||||||
Be aware that if there is more than one pattern expanding into a same selection (which also shares the same ```name``` field), the pattern appearing later in the spec JSON will overwrite a previously generated selection. To make sure this is not undetected when generating, set the value of the ```expansion``` field to ```default``` for an expansion appearing earlier and ```override``` for the one appearing later.
|
|
||||||
|
|
||||||
A **selection** is a single **test instance** (scenario) with explicit values, for example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var scenario = {
|
|
||||||
"referrer_policy": "origin-when-cross-origin",
|
|
||||||
"delivery_method": "meta-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "origin"
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Essentially, this is what gets generated and defines a single test. The scenario is then evaluated by the ```ReferrerPolicyTestCase``` in JS. For the rest of the arranging part, see the ```./generic/template/``` directory and examine ```./generic/tools/generate.py``` to see how the values for the templates are produced.
|
|
||||||
|
|
||||||
|
|
||||||
Taking the spec JSON, the generator follows this algorithm:
|
|
||||||
|
|
||||||
* Expand all ```excluded_tests``` to create a blacklist of selections
|
|
||||||
|
|
||||||
* For each specification requirement: Expand the ```test_expansion``` pattern into selections and check each against the blacklist, if not marked as suppresed, generate the test resources for the selection
|
|
||||||
|
|
|
@ -1,325 +0,0 @@
|
||||||
// NOTE: This method only strips the fragment and is not in accordance to the
|
|
||||||
// recommended draft specification:
|
|
||||||
// https://w3c.github.io/webappsec/specs/referrer-policy/#null
|
|
||||||
// TODO(kristijanburnik): Implement this helper as defined by spec once added
|
|
||||||
// scenarios for URLs containing username/password/etc.
|
|
||||||
function stripUrlForUseAsReferrer(url) {
|
|
||||||
return url.replace(/#.*$/, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseUrlQueryString(queryString) {
|
|
||||||
var queries = queryString.replace(/^\?/, "").split("&");
|
|
||||||
var params = {};
|
|
||||||
|
|
||||||
for (var i in queries) {
|
|
||||||
var kvp = queries[i].split("=");
|
|
||||||
params[kvp[0]] = kvp[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return params;
|
|
||||||
};
|
|
||||||
|
|
||||||
function appendIframeToBody(url, attributes) {
|
|
||||||
var iframe = document.createElement("iframe");
|
|
||||||
iframe.src = url;
|
|
||||||
// Extend element with attributes. (E.g. "referrerPolicy" or "rel")
|
|
||||||
if (attributes) {
|
|
||||||
for (var attr in attributes) {
|
|
||||||
iframe[attr] = attributes[attr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.body.appendChild(iframe);
|
|
||||||
|
|
||||||
return iframe;
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadImage(src, callback, attributes) {
|
|
||||||
var image = new Image();
|
|
||||||
image.crossOrigin = "Anonymous";
|
|
||||||
image.onload = function() {
|
|
||||||
callback(image);
|
|
||||||
}
|
|
||||||
image.src = src;
|
|
||||||
// Extend element with attributes. (E.g. "referrerPolicy" or "rel")
|
|
||||||
if (attributes) {
|
|
||||||
for (var attr in attributes) {
|
|
||||||
image[attr] = attributes[attr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.body.appendChild(image)
|
|
||||||
}
|
|
||||||
|
|
||||||
function decodeImageData(rgba) {
|
|
||||||
var rgb = new Uint8ClampedArray(rgba.length);
|
|
||||||
|
|
||||||
// RGBA -> RGB.
|
|
||||||
var rgb_length = 0;
|
|
||||||
for (var i = 0; i < rgba.length; ++i) {
|
|
||||||
// Skip alpha component.
|
|
||||||
if (i % 4 == 3)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Zero is the string terminator.
|
|
||||||
if (rgba[i] == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
rgb[rgb_length++] = rgba[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove trailing nulls from data.
|
|
||||||
rgb = rgb.subarray(0, rgb_length);
|
|
||||||
var string_data = (new TextDecoder("ascii")).decode(rgb);
|
|
||||||
|
|
||||||
return JSON.parse(string_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
function decodeImage(url, callback, referrer_policy) {
|
|
||||||
loadImage(url, function(img) {
|
|
||||||
var canvas = document.createElement("canvas");
|
|
||||||
var context = canvas.getContext('2d');
|
|
||||||
context.drawImage(img, 0, 0);
|
|
||||||
var imgData = context.getImageData(0, 0, img.clientWidth, img.clientHeight);
|
|
||||||
callback(decodeImageData(imgData.data))
|
|
||||||
}, referrer_policy);
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizePort(targetPort) {
|
|
||||||
var defaultPorts = [80, 443];
|
|
||||||
var isDefaultPortForProtocol = (defaultPorts.indexOf(targetPort) >= 0);
|
|
||||||
|
|
||||||
return (targetPort == "" || isDefaultPortForProtocol) ?
|
|
||||||
"" : ":" + targetPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
function wrapResult(url, server_data) {
|
|
||||||
return {
|
|
||||||
location: url,
|
|
||||||
referrer: server_data.headers.referer,
|
|
||||||
headers: server_data.headers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryIframe(url, callback, referrer_policy) {
|
|
||||||
var x = document.createElement('script');
|
|
||||||
x.src = '/common/utils.js';
|
|
||||||
x.onerror = function() { console.log('whoops') };
|
|
||||||
x.onload = function() { doQuery() };
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(x);
|
|
||||||
|
|
||||||
function doQuery() {
|
|
||||||
var id = token();
|
|
||||||
var iframe = appendIframeToBody(url + "&id=" + id, referrer_policy);
|
|
||||||
iframe.addEventListener("load", function listener() {
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', '/_mozilla/mozilla/referrer-policy/generic/subresource/stash.py?id=' + id, false);
|
|
||||||
xhr.onload = function(e) {
|
|
||||||
var server_data = JSON.parse(this.responseText);
|
|
||||||
callback(server_data);
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
iframe.removeEventListener("load", listener);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryImage(url, callback, referrer_policy) {
|
|
||||||
decodeImage(url, function(server_data) {
|
|
||||||
callback(wrapResult(url, server_data), url);
|
|
||||||
}, referrer_policy)
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryXhr(url, callback) {
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', url, true);
|
|
||||||
xhr.onload = function(e) {
|
|
||||||
var server_data = JSON.parse(this.responseText);
|
|
||||||
callback(wrapResult(url, server_data), url);
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryWorker(url, callback) {
|
|
||||||
var worker = new Worker(url);
|
|
||||||
worker.onmessage = function(event) {
|
|
||||||
var server_data = event.data;
|
|
||||||
callback(wrapResult(url, server_data), url);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryFetch(url, callback) {
|
|
||||||
fetch(url).then(function(response) {
|
|
||||||
response.json().then(function(server_data) {
|
|
||||||
callback(wrapResult(url, server_data), url);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryNavigable(element, url, callback, attributes) {
|
|
||||||
var navigable = element
|
|
||||||
navigable.href = url;
|
|
||||||
navigable.target = "helper-iframe";
|
|
||||||
|
|
||||||
var helperIframe = document.createElement("iframe")
|
|
||||||
helperIframe.name = "helper-iframe"
|
|
||||||
document.body.appendChild(helperIframe)
|
|
||||||
|
|
||||||
// Extend element with attributes. (E.g. "referrer_policy" or "rel")
|
|
||||||
if (attributes) {
|
|
||||||
for (var attr in attributes) {
|
|
||||||
navigable[attr] = attributes[attr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var listener = function(event) {
|
|
||||||
if (event.source != helperIframe.contentWindow)
|
|
||||||
return;
|
|
||||||
|
|
||||||
callback(event.data, url);
|
|
||||||
window.removeEventListener("message", listener);
|
|
||||||
}
|
|
||||||
window.addEventListener("message", listener);
|
|
||||||
|
|
||||||
navigable.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryAnchor(url, callback, referrer_policy) {
|
|
||||||
var x = document.createElement('script');
|
|
||||||
x.src = '/common/utils.js';
|
|
||||||
x.onerror = function() { console.log('whoops') };
|
|
||||||
x.onload = function() { doQuery() };
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(x);
|
|
||||||
|
|
||||||
function doQuery() {
|
|
||||||
var id = token();
|
|
||||||
|
|
||||||
var document_url = new URL(url);
|
|
||||||
var document_protocol = document_url.protocol;
|
|
||||||
var document_host = document_url.host;
|
|
||||||
|
|
||||||
// TODO This is a workaround to pass tests which their referrer policy
|
|
||||||
// changed when source and destination has different protocol or host.
|
|
||||||
//
|
|
||||||
// Here we store url's protocol and host, then make url's protocol and
|
|
||||||
// host equal to window's. Finally, we pass the protocol and host we
|
|
||||||
// stored as url arguments while loading url. So that url knows what
|
|
||||||
// protocol and host to load the actual document.py and makes tests
|
|
||||||
// meaningful and correct.
|
|
||||||
document_url.protocol = window.location.protocol;
|
|
||||||
document_url.host = window.location.host;
|
|
||||||
|
|
||||||
// Due to limitation of current test implementation, we are unable to
|
|
||||||
// capture referrer policy from meta tags and http header of test
|
|
||||||
// harness directly. To overcome it, we extract these information from
|
|
||||||
// meta tags and pass it to url which we're going to load for future
|
|
||||||
// use.
|
|
||||||
var meta_referrer = undefined;
|
|
||||||
var http_referrer = undefined;
|
|
||||||
for (var meta of document.head.querySelectorAll("meta")) {
|
|
||||||
if (meta.name === "referrer") {
|
|
||||||
meta_referrer = meta.content;
|
|
||||||
} else if (meta.name === "http-referrer-policy") {
|
|
||||||
http_referrer = meta.content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var url_with_params = document_url.toString() +
|
|
||||||
"&id=" + id +
|
|
||||||
"&tagAttrs=" + JSON.stringify(referrer_policy) +
|
|
||||||
"&metaReferrer=" + meta_referrer +
|
|
||||||
"&httpReferrer=" + http_referrer +
|
|
||||||
"&protocol=" + document_protocol +
|
|
||||||
"&host=" + document_host;
|
|
||||||
|
|
||||||
var iframe = appendIframeToBody(url_with_params);
|
|
||||||
iframe.addEventListener("load", function listener() {
|
|
||||||
if ((iframe.contentDocument !== null) &&
|
|
||||||
(iframe.contentDocument.location.toString() === url_with_params)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', '/_mozilla/mozilla/referrer-policy/generic/subresource/stash.py?path=a-tag-document-url&id=' + id, false);
|
|
||||||
xhr.send();
|
|
||||||
var expected_url = JSON.parse(xhr.responseText);
|
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', '/_mozilla/mozilla/referrer-policy/generic/subresource/stash.py?id=' + id, false);
|
|
||||||
xhr.onload = function(e) {
|
|
||||||
var server_data = JSON.parse(this.responseText);
|
|
||||||
|
|
||||||
callback(server_data, expected_url);
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
|
|
||||||
iframe.removeEventListener("load", listener);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryAreaLink(url, callback, referrer_policy) {
|
|
||||||
var area = document.createElement("area");
|
|
||||||
// TODO(kristijanburnik): Append to map and add image.
|
|
||||||
document.body.appendChild(area);
|
|
||||||
queryNavigable(area, url, callback, referrer_policy)
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryScript(url, callback) {
|
|
||||||
var script = document.createElement("script");
|
|
||||||
script.src = url;
|
|
||||||
|
|
||||||
var listener = function(event) {
|
|
||||||
var server_data = event.data;
|
|
||||||
callback(wrapResult(url, server_data), url);
|
|
||||||
window.removeEventListener("message", listener);
|
|
||||||
}
|
|
||||||
window.addEventListener("message", listener);
|
|
||||||
|
|
||||||
document.body.appendChild(script);
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryLink(url, callback, referrer_policy) {
|
|
||||||
var x = document.createElement('script');
|
|
||||||
x.src = '/common/utils.js';
|
|
||||||
x.onerror = function() { console.log('whoops') };
|
|
||||||
x.onload = function() { doQuery() };
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(x);
|
|
||||||
|
|
||||||
function doQuery() {
|
|
||||||
var id = token();
|
|
||||||
var link = document.createElement("link");
|
|
||||||
|
|
||||||
for (var attr in referrer_policy) {
|
|
||||||
link[attr] = referrer_policy[attr];
|
|
||||||
}
|
|
||||||
|
|
||||||
link.href = url + "&id=" + id;
|
|
||||||
link.relList.add("stylesheet");
|
|
||||||
|
|
||||||
link.onload = function() {
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', '/_mozilla/mozilla/referrer-policy/generic/subresource/stash.py?path=link-element-stash&id=' + id, false);
|
|
||||||
xhr.onload = function(e) {
|
|
||||||
var server_data = JSON.parse(this.responseText);
|
|
||||||
server_data.headers = JSON.parse(server_data.headers);
|
|
||||||
if (server_data.headers.referer == undefined) {
|
|
||||||
server_data.headers.referer = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(wrapResult(url, server_data));
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
};
|
|
||||||
|
|
||||||
document.body.appendChild(link);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SanityChecker does nothing in release mode.
|
|
||||||
function SanityChecker() {}
|
|
||||||
SanityChecker.prototype.checkScenario = function() {};
|
|
||||||
SanityChecker.prototype.checkSubresourceResult = function() {};
|
|
||||||
|
|
||||||
// TODO(kristijanburnik): document.origin is supported since Chrome 41,
|
|
||||||
// other browsers still don't support it. Remove once they do.
|
|
||||||
document.origin = document.origin || (location.protocol + "//" + location.host);
|
|
|
@ -1,140 +0,0 @@
|
||||||
function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) {
|
|
||||||
// Pass and skip rest of the test if browser does not support fetch.
|
|
||||||
if (scenario.subresource == "fetch-request" && !window.fetch) {
|
|
||||||
// TODO(kristijanburnik): This should be refactored.
|
|
||||||
return {
|
|
||||||
start: function() {
|
|
||||||
test(function() { assert_true(true); },
|
|
||||||
"[ReferrerPolicyTestCase] Skipping test: Fetch is not supported.");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// This check is A NOOP in release.
|
|
||||||
sanityChecker.checkScenario(scenario);
|
|
||||||
|
|
||||||
var subresourceInvoker = {
|
|
||||||
"a-tag": queryAnchor,
|
|
||||||
"area-tag": queryAreaLink,
|
|
||||||
"fetch-request": queryFetch,
|
|
||||||
"iframe-tag": queryIframe,
|
|
||||||
"img-tag": queryImage,
|
|
||||||
"script-tag": queryScript,
|
|
||||||
"worker-request": queryWorker,
|
|
||||||
"xhr-request": queryXhr,
|
|
||||||
"link-tag": queryLink
|
|
||||||
};
|
|
||||||
|
|
||||||
var referrerUrlResolver = {
|
|
||||||
"omitted": function() {
|
|
||||||
return undefined;
|
|
||||||
},
|
|
||||||
"origin": function() {
|
|
||||||
return document.origin + "/";
|
|
||||||
},
|
|
||||||
"stripped-referrer": function() {
|
|
||||||
return stripUrlForUseAsReferrer(location.toString());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var t = {
|
|
||||||
_scenario: scenario,
|
|
||||||
_testDescription: testDescription,
|
|
||||||
_subresourceUrl: null,
|
|
||||||
_expectedReferrerUrl: null,
|
|
||||||
_constructSubresourceUrl: function() {
|
|
||||||
// TODO(kristijanburnik): We should assert that these two domains are
|
|
||||||
// different. E.g. If someone runs the tets over www, this would fail.
|
|
||||||
var domainForOrigin = {
|
|
||||||
"cross-origin":"{{domains[www1]}}",
|
|
||||||
"same-origin": location.hostname
|
|
||||||
};
|
|
||||||
|
|
||||||
// Values obtained and replaced by the wptserve pipeline:
|
|
||||||
// http://wptserve.readthedocs.org/en/latest/pipes.html#built-in-pipes
|
|
||||||
var portForProtocol = {
|
|
||||||
"http": parseInt("{{ports[http][0]}}"),
|
|
||||||
"https": parseInt("{{ports[https][0]}}")
|
|
||||||
}
|
|
||||||
|
|
||||||
var targetPort = portForProtocol[t._scenario.target_protocol];
|
|
||||||
|
|
||||||
t._subresourceUrl = t._scenario.target_protocol + "://" +
|
|
||||||
domainForOrigin[t._scenario.origin] +
|
|
||||||
normalizePort(targetPort) +
|
|
||||||
t._scenario["subresource_path"] +
|
|
||||||
"?redirection=" + t._scenario["redirection"] +
|
|
||||||
"&cache_destroyer=" + (new Date()).getTime();
|
|
||||||
},
|
|
||||||
|
|
||||||
_constructExpectedReferrerUrl: function() {
|
|
||||||
t._expectedReferrerUrl = referrerUrlResolver[t._scenario.referrer_url]();
|
|
||||||
},
|
|
||||||
|
|
||||||
_invokeSubresource: function(callback) {
|
|
||||||
var invoker = subresourceInvoker[t._scenario.subresource];
|
|
||||||
|
|
||||||
// Depending on the delivery method, extend the subresource element with
|
|
||||||
// these attributes.
|
|
||||||
var elementAttributesForDeliveryMethod = {
|
|
||||||
"attr-referrer": {referrerPolicy: t._scenario.referrer_policy},
|
|
||||||
"rel-noreferrer": {rel: "noreferrer"}
|
|
||||||
};
|
|
||||||
|
|
||||||
var delivery_method = t._scenario.delivery_method;
|
|
||||||
|
|
||||||
if (delivery_method in elementAttributesForDeliveryMethod) {
|
|
||||||
invoker(t._subresourceUrl,
|
|
||||||
callback,
|
|
||||||
elementAttributesForDeliveryMethod[delivery_method]);
|
|
||||||
} else {
|
|
||||||
invoker(t._subresourceUrl, callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
start: function() {
|
|
||||||
t._constructSubresourceUrl();
|
|
||||||
t._constructExpectedReferrerUrl();
|
|
||||||
|
|
||||||
var test = async_test(t._testDescription);
|
|
||||||
|
|
||||||
// FIXME Pass value to `expected_referrer` only if there's some
|
|
||||||
// technical restrictions to pass (eg. postMessage is not
|
|
||||||
// available).
|
|
||||||
t._invokeSubresource(function(result, expected_referrer) {
|
|
||||||
// Check if the result is in valid format. NOOP in release.
|
|
||||||
sanityChecker.checkSubresourceResult(
|
|
||||||
test, t._scenario, t._subresourceUrl, result);
|
|
||||||
|
|
||||||
// Check the reported URL.
|
|
||||||
test.step(function() {
|
|
||||||
if (expected_referrer) {
|
|
||||||
expected_referrer = new URL(expected_referrer);
|
|
||||||
if (t._scenario.referrer_url === "omitted") {
|
|
||||||
expected_referrer = undefined;
|
|
||||||
} else if (t._scenario.referrer_url === "origin") {
|
|
||||||
expected_referrer = expected_referrer.origin + "/";
|
|
||||||
} else if (t._scenario.referrer_url === "stripped-referrer") {
|
|
||||||
expected_referrer = stripUrlForUseAsReferrer(expected_referrer.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
expected_referrer = expected_referrer || t._expectedReferrerUrl;
|
|
||||||
|
|
||||||
assert_equals(result.referrer,
|
|
||||||
expected_referrer,
|
|
||||||
"Reported Referrer URL is '" + expected_referrer + "'.");
|
|
||||||
assert_equals(result.headers.referer,
|
|
||||||
expected_referrer,
|
|
||||||
"Reported Referrer URL from HTTP header is '" + expected_referrer + "'");
|
|
||||||
}, "Reported Referrer URL is as expected: " + (expected_referrer || t._expectedReferrerUrl));
|
|
||||||
|
|
||||||
test.done();
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
// The SanityChecker is used in debug mode to identify problems with the
|
|
||||||
// structure of the testsuite. In release mode it is mocked out to do nothing.
|
|
||||||
|
|
||||||
function SanityChecker() {}
|
|
||||||
|
|
||||||
SanityChecker.prototype.checkScenario = function(scenario) {
|
|
||||||
// Check if scenario is valid.
|
|
||||||
// TODO(kristijanburnik): Move to a sanity-checks.js for debug mode only.
|
|
||||||
test(function() {
|
|
||||||
|
|
||||||
// We extend the exsiting test_expansion_schema not to kill performance by
|
|
||||||
// copying.
|
|
||||||
var expectedFields = SPEC_JSON["test_expansion_schema"];
|
|
||||||
expectedFields["referrer_policy"] = SPEC_JSON["referrer_policy_schema"];
|
|
||||||
|
|
||||||
assert_own_property(scenario, "subresource_path",
|
|
||||||
"Scenario has the path to the subresource.");
|
|
||||||
|
|
||||||
for (var field in expectedFields) {
|
|
||||||
assert_own_property(scenario, field,
|
|
||||||
"The scenario contains field " + field)
|
|
||||||
assert_in_array(scenario[field], expectedFields[field],
|
|
||||||
"Scenario's " + field + " is one of: " +
|
|
||||||
expectedFields[field].join(", ")) + "."
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the protocol is matched.
|
|
||||||
assert_equals(scenario["source_protocol"] + ":", location.protocol,
|
|
||||||
"Protocol of the test page should match the scenario.")
|
|
||||||
|
|
||||||
}, "[ReferrerPolicyTestCase] The test scenario is valid.");
|
|
||||||
}
|
|
||||||
|
|
||||||
SanityChecker.prototype.checkSubresourceResult = function(test,
|
|
||||||
scenario,
|
|
||||||
subresourceUrl,
|
|
||||||
result) {
|
|
||||||
test.step(function() {
|
|
||||||
assert_equals(Object.keys(result).length, 3);
|
|
||||||
assert_own_property(result, "location");
|
|
||||||
assert_own_property(result, "referrer");
|
|
||||||
assert_own_property(result, "headers");
|
|
||||||
|
|
||||||
// Skip location check for scripts.
|
|
||||||
if (scenario.subresource == "script-tag")
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Sanity check: location of sub-resource matches reported location.
|
|
||||||
assert_equals(result.location, subresourceUrl,
|
|
||||||
"Subresource reported location.");
|
|
||||||
}, "Running a valid test scenario.");
|
|
||||||
};
|
|
|
@ -1,60 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
var url = new URL(window.location.toString());
|
|
||||||
var id = url.searchParams.get("id");
|
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', 'stash.py?path=a-tag-stash&id=' + id, false);
|
|
||||||
xhr.send();
|
|
||||||
params = JSON.parse(xhr.responseText);
|
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('POST', 'stash.py?path=a-tag-document-url&id=' + id, false);
|
|
||||||
xhr.send(JSON.stringify(window.location.toString()));
|
|
||||||
|
|
||||||
var redirection = params["redirection"];
|
|
||||||
var cache_destroyer = params["cache_destroyer"];
|
|
||||||
var tag_attrs = params["tagAttrs"];
|
|
||||||
var meta_referrer = params["metaReferrer"];
|
|
||||||
var protocol = params["protocol"];
|
|
||||||
var host = params["host"];
|
|
||||||
|
|
||||||
var referrer_policy;
|
|
||||||
try {
|
|
||||||
referrer_policy = JSON.parse(tag_attrs);
|
|
||||||
} catch(e) {
|
|
||||||
referrer_policy = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meta_referrer !== "undefined") {
|
|
||||||
var meta = document.createElement("meta");
|
|
||||||
meta.name = "referrer";
|
|
||||||
meta.content = meta_referrer;
|
|
||||||
|
|
||||||
document.head.appendChild(meta);
|
|
||||||
}
|
|
||||||
|
|
||||||
var a = document.createElement("a");
|
|
||||||
a.href = protocol + "//" + host +
|
|
||||||
"/_mozilla/mozilla/referrer-policy/generic/subresource/document.py" +
|
|
||||||
"?id=" + id +
|
|
||||||
"&redirection=" + redirection +
|
|
||||||
"&cache_destroyer=" + cache_destroyer;
|
|
||||||
|
|
||||||
// referrer_policy could be:
|
|
||||||
// {rel: "noreferrer"}, or
|
|
||||||
// {referrerPolicy: "POLICY_YOU_CHOOSE"}
|
|
||||||
for (var attr in referrer_policy) {
|
|
||||||
a[attr] = referrer_policy[attr];
|
|
||||||
}
|
|
||||||
|
|
||||||
document.body.appendChild(a);
|
|
||||||
|
|
||||||
a.click();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,22 +0,0 @@
|
||||||
import os, json, sys
|
|
||||||
this_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
sys.path.insert(0, this_dir)
|
|
||||||
|
|
||||||
import mozresource; subresource = mozresource
|
|
||||||
|
|
||||||
def generate_payload(server_data):
|
|
||||||
with open(os.path.join(this_dir, "a-tag.html")) as f:
|
|
||||||
return f.read()
|
|
||||||
|
|
||||||
def main(request, response):
|
|
||||||
path = 'a-tag-stash'
|
|
||||||
server_data = json.dumps(request.GET)
|
|
||||||
stashed_data = request.server.stash.take(request.GET["id"], path)
|
|
||||||
if stashed_data:
|
|
||||||
server_data = stashed_data
|
|
||||||
request.server.stash.put(request.GET["id"], server_data, path)
|
|
||||||
http_header_referrer_policy = request.GET["httpReferrer"] if "httpReferrer" in request.GET else None
|
|
||||||
subresource.respond(request,
|
|
||||||
response,
|
|
||||||
payload_generator = generate_payload,
|
|
||||||
http_header_referrer_policy = http_header_referrer_policy)
|
|
|
@ -1,12 +0,0 @@
|
||||||
import os, json, sys
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
||||||
|
|
||||||
import mozresource; subresource = mozresource
|
|
||||||
|
|
||||||
def generate_payload(server_data):
|
|
||||||
return subresource.get_template("document.html.template") % server_data
|
|
||||||
|
|
||||||
def main(request, response):
|
|
||||||
subresource.respond(request,
|
|
||||||
response,
|
|
||||||
payload_generator = generate_payload)
|
|
|
@ -1,27 +0,0 @@
|
||||||
import os, json, sys, urllib2, urlparse
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
||||||
|
|
||||||
import mozresource; subresource = mozresource
|
|
||||||
|
|
||||||
def generate_payload(server_data):
|
|
||||||
return subresource.get_template("css.template") % server_data
|
|
||||||
|
|
||||||
def main(request, response):
|
|
||||||
# TODO: When HTMLLinkElement.sheet is available, don't need this
|
|
||||||
# workaround anymore. We could store data into css.template and
|
|
||||||
# read it from HTMLLinkElement.sheet.
|
|
||||||
path = 'link-element-stash'
|
|
||||||
server_data = {"headers": json.dumps(request.headers, indent = 4)}
|
|
||||||
|
|
||||||
# We do this because in those tests which cause redirection, this
|
|
||||||
# subresource will be called at least twice. And putting data onto stash
|
|
||||||
# more than once is not a valid operation (it'll throw exception). When
|
|
||||||
# there's already something in stash, we simply take it out and put the
|
|
||||||
# new one back since we only interesting in the last request.
|
|
||||||
stashed_data = request.server.stash.take(request.GET["id"], path)
|
|
||||||
|
|
||||||
request.server.stash.put(request.GET["id"], json.dumps(server_data), path)
|
|
||||||
|
|
||||||
subresource.respond(request,
|
|
||||||
response,
|
|
||||||
payload_generator = generate_payload)
|
|
|
@ -1,99 +0,0 @@
|
||||||
import os, sys, json, urlparse, urllib
|
|
||||||
|
|
||||||
def get_template(template_basename):
|
|
||||||
script_directory = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
template_directory = os.path.abspath(os.path.join(script_directory,
|
|
||||||
"..",
|
|
||||||
"template"))
|
|
||||||
template_filename = os.path.join(template_directory, template_basename);
|
|
||||||
|
|
||||||
with open(template_filename) as f:
|
|
||||||
return f.read()
|
|
||||||
|
|
||||||
# TODO(kristijanburnik): subdomain_prefix is a hardcoded value aligned with
|
|
||||||
# referrer-policy-test-case.js. The prefix should be configured in one place.
|
|
||||||
def get_swapped_origin_netloc(netloc, subdomain_prefix = "www1."):
|
|
||||||
if netloc.startswith(subdomain_prefix):
|
|
||||||
return netloc[len(subdomain_prefix):]
|
|
||||||
else:
|
|
||||||
return subdomain_prefix + netloc
|
|
||||||
|
|
||||||
def create_redirect_url(request, cross_origin = False):
|
|
||||||
parsed = urlparse.urlsplit(request.url)
|
|
||||||
destination_netloc = parsed.netloc
|
|
||||||
if cross_origin:
|
|
||||||
destination_netloc = get_swapped_origin_netloc(parsed.netloc)
|
|
||||||
|
|
||||||
query = filter(lambda x: not x.startswith('redirection='), parsed.query.split('&'))
|
|
||||||
destination_url = urlparse.urlunsplit(urlparse.SplitResult(
|
|
||||||
scheme = parsed.scheme,
|
|
||||||
netloc = destination_netloc,
|
|
||||||
path = parsed.path,
|
|
||||||
query = '&'.join(query),
|
|
||||||
fragment = None))
|
|
||||||
|
|
||||||
return destination_url
|
|
||||||
|
|
||||||
|
|
||||||
def redirect(url, response):
|
|
||||||
response.add_required_headers = False
|
|
||||||
response.writer.write_status(301)
|
|
||||||
response.writer.write_header("access-control-allow-origin", "*")
|
|
||||||
response.writer.write_header("location", url)
|
|
||||||
response.writer.end_headers()
|
|
||||||
response.writer.write("")
|
|
||||||
|
|
||||||
|
|
||||||
def preprocess_redirection(request, response):
|
|
||||||
if "redirection" not in request.GET:
|
|
||||||
return False
|
|
||||||
|
|
||||||
redirection = request.GET["redirection"]
|
|
||||||
|
|
||||||
if redirection == "no-redirect":
|
|
||||||
return False
|
|
||||||
elif redirection == "keep-origin-redirect":
|
|
||||||
redirect_url = create_redirect_url(request, cross_origin = False)
|
|
||||||
elif redirection == "swap-origin-redirect":
|
|
||||||
redirect_url = create_redirect_url(request, cross_origin = True)
|
|
||||||
else:
|
|
||||||
raise ValueError("Invalid redirection type '%s'" % redirection)
|
|
||||||
|
|
||||||
redirect(redirect_url, response)
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def __noop(request, response):
|
|
||||||
return ""
|
|
||||||
|
|
||||||
|
|
||||||
def respond(request,
|
|
||||||
response,
|
|
||||||
status_code = 200,
|
|
||||||
content_type = "text/html",
|
|
||||||
payload_generator = __noop,
|
|
||||||
cache_control = "no-cache; must-revalidate",
|
|
||||||
access_control_allow_origin = "*",
|
|
||||||
http_header_referrer_policy = None):
|
|
||||||
if preprocess_redirection(request, response):
|
|
||||||
return
|
|
||||||
|
|
||||||
response.add_required_headers = False
|
|
||||||
response.writer.write_status(status_code)
|
|
||||||
|
|
||||||
if access_control_allow_origin != None:
|
|
||||||
response.writer.write_header("access-control-allow-origin",
|
|
||||||
access_control_allow_origin)
|
|
||||||
if http_header_referrer_policy != None:
|
|
||||||
response.writer.write_header("referrer-policy",
|
|
||||||
http_header_referrer_policy)
|
|
||||||
response.writer.write_header("content-type", content_type)
|
|
||||||
response.writer.write_header("cache-control", cache_control)
|
|
||||||
response.writer.end_headers()
|
|
||||||
|
|
||||||
server_data = {"headers": json.dumps(request.headers, indent = 4)}
|
|
||||||
|
|
||||||
payload = payload_generator(server_data)
|
|
||||||
response.writer.write(payload)
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
def main(request, response):
|
|
||||||
path = request.GET["path"] if "path" in request.GET else None
|
|
||||||
if request.method == 'POST':
|
|
||||||
request.server.stash.put(request.GET["id"], request.body, path)
|
|
||||||
return ''
|
|
||||||
|
|
||||||
return request.server.stash.take(request.GET["id"], path)
|
|
|
@ -1,3 +0,0 @@
|
||||||
h1 {
|
|
||||||
content: "%(headers)s";
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
<!-- DO NOT EDIT! Generated by %(generating_script_filename)s using %(html_template_filename)s. -->
|
|
|
@ -1,32 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>This page reports back it's request details to the parent frame</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
function getQueryVariable(variable)
|
|
||||||
{
|
|
||||||
var query = window.location.search.substring(1);
|
|
||||||
var vars = query.split("&");
|
|
||||||
for (var i=0;i<vars.length;i++) {
|
|
||||||
var pair = vars[i].split("=");
|
|
||||||
if(pair[0] == variable){return pair[1];}
|
|
||||||
}
|
|
||||||
return(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
var referrer = document.referrer.length > 0 ? document.referrer : undefined;
|
|
||||||
|
|
||||||
var result = {
|
|
||||||
location: document.location.toString(),
|
|
||||||
referrer: referrer,
|
|
||||||
headers: %(headers)s
|
|
||||||
};
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('POST', 'stash.py?id=' + getQueryVariable("id"), false);
|
|
||||||
xhr.send(JSON.stringify(result));
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,3 +0,0 @@
|
||||||
postMessage({
|
|
||||||
"headers": %(headers)s
|
|
||||||
}, "*");
|
|
|
@ -1 +0,0 @@
|
||||||
var SPEC_JSON = %(spec_json)s;
|
|
|
@ -1,70 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
%(generated_disclaimer)s
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: %(spec_title)s</title>%(meta_delivery_method)s
|
|
||||||
<meta name="description" content="%(spec_description)s">
|
|
||||||
<meta name="assert" content="%(test_description)s">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- Common global functions for referrer-policy tests. -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<!-- The original specification JSON for validating the scenario. -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/spec_json.js"></script>
|
|
||||||
<!-- Internal checking of the tests -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/sanity-checker.js"></script>
|
|
||||||
<!-- Simple wrapper API for all referrer-policy test cases. -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>%(spec_title)s</h1>
|
|
||||||
<h2>%(spec_description)s</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<script>
|
|
||||||
// Show the detailed assertion description of the test.
|
|
||||||
document.write(document.querySelector("meta[name=assert]").content);
|
|
||||||
</script>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>See <a href="%(spec_specification_url)s" target="_blank">specification</a>
|
|
||||||
details for this test.</p>
|
|
||||||
|
|
||||||
<h3>Scenario outline</h3>
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th>Delivery method</th>
|
|
||||||
<td>%(delivery_method)s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Redirection</th>
|
|
||||||
<td>%(redirection)s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Origin transition</th>
|
|
||||||
<td>%(origin)s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Protocol transition</th>
|
|
||||||
<td>from %(source_protocol)s to %(target_protocol)s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Subresource type</th>
|
|
||||||
<td>%(subresource)s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><hr></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Expected result</th>
|
|
||||||
<td>Referrer URL should be <strong>%(referrer_url)s</strong></td>
|
|
||||||
</tr>
|
|
||||||
<tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<script>%(test_js)s</script>
|
|
||||||
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,15 +0,0 @@
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": %(referrer_policy_json)s,
|
|
||||||
"delivery_method": "%(delivery_method)s",
|
|
||||||
"redirection": "%(redirection)s",
|
|
||||||
"origin": "%(origin)s",
|
|
||||||
"source_protocol": "%(source_protocol)s",
|
|
||||||
"target_protocol": "%(target_protocol)s",
|
|
||||||
"subresource": "%(subresource)s",
|
|
||||||
"subresource_path": "%(subresource_path)s",
|
|
||||||
"referrer_url": "%(referrer_url)s"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
|
@ -1,20 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
%(generated_disclaimer)s
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: %(spec_title)s</title>
|
|
||||||
<meta name="description" content="%(spec_description)s">%(meta_delivery_method)s
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="%(spec_specification_url)s">
|
|
||||||
<meta name="assert" content="%(test_description)s">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>%(test_js)s</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,5 +0,0 @@
|
||||||
The referrer URL is %(referrer_url)s when a
|
|
||||||
document served over %(source_protocol)s requires an %(target_protocol)s
|
|
||||||
sub-resource via %(subresource)s using the %(delivery_method)s
|
|
||||||
delivery method with %(redirection)s and when
|
|
||||||
the target request is %(origin)s.
|
|
|
@ -1,3 +0,0 @@
|
||||||
postMessage({
|
|
||||||
"headers": %(headers)s
|
|
||||||
});
|
|
|
@ -1,35 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import os, json
|
|
||||||
from common_paths import *
|
|
||||||
import spec_validator
|
|
||||||
|
|
||||||
def rmtree(top):
|
|
||||||
top = os.path.abspath(top)
|
|
||||||
assert top != os.path.expanduser("~")
|
|
||||||
assert len(top) > len(os.path.expanduser("~"))
|
|
||||||
assert "web-platform-tests" in top
|
|
||||||
assert "referrer-policy" in top
|
|
||||||
|
|
||||||
for root, dirs, files in os.walk(top, topdown=False):
|
|
||||||
for name in files:
|
|
||||||
os.remove(os.path.join(root, name))
|
|
||||||
for name in dirs:
|
|
||||||
os.rmdir(os.path.join(root, name))
|
|
||||||
|
|
||||||
os.rmdir(top)
|
|
||||||
|
|
||||||
def main():
|
|
||||||
spec_json = load_spec_json();
|
|
||||||
spec_validator.assert_valid_spec_json(spec_json)
|
|
||||||
|
|
||||||
for spec in spec_json['specification']:
|
|
||||||
generated_dir = os.path.join(spec_directory, spec["name"])
|
|
||||||
if (os.path.isdir(generated_dir)):
|
|
||||||
rmtree(generated_dir)
|
|
||||||
|
|
||||||
if (os.path.isfile(generated_spec_json_filename)):
|
|
||||||
os.remove(generated_spec_json_filename)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
|
@ -1,52 +0,0 @@
|
||||||
import os, sys, json, re
|
|
||||||
|
|
||||||
script_directory = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
|
|
||||||
|
|
||||||
template_directory = os.path.abspath(os.path.join(script_directory,
|
|
||||||
'..',
|
|
||||||
'template'))
|
|
||||||
spec_directory = os.path.abspath(os.path.join(script_directory, '..', '..'))
|
|
||||||
test_root_directory = os.path.abspath(os.path.join(script_directory,
|
|
||||||
'..', '..', '..'))
|
|
||||||
|
|
||||||
spec_filename = os.path.join(spec_directory, "spec.src.json")
|
|
||||||
generated_spec_json_filename = os.path.join(spec_directory, "spec_json.js")
|
|
||||||
|
|
||||||
selection_pattern = '%(delivery_method)s/' + \
|
|
||||||
'%(origin)s/' + \
|
|
||||||
'%(source_protocol)s-%(target_protocol)s/' + \
|
|
||||||
'%(subresource)s/'
|
|
||||||
|
|
||||||
test_file_path_pattern = '%(spec_name)s/' + selection_pattern + \
|
|
||||||
'%(name)s.%(redirection)s.%(source_protocol)s.html'
|
|
||||||
|
|
||||||
|
|
||||||
def get_template(basename):
|
|
||||||
with open(os.path.join(template_directory, basename)) as f:
|
|
||||||
return f.read()
|
|
||||||
|
|
||||||
|
|
||||||
def read_nth_line(fp, line_number):
|
|
||||||
fp.seek(0)
|
|
||||||
for i, line in enumerate(fp):
|
|
||||||
if (i + 1) == line_number:
|
|
||||||
return line
|
|
||||||
|
|
||||||
|
|
||||||
def load_spec_json():
|
|
||||||
re_error_location = re.compile('line ([0-9]+) column ([0-9]+)')
|
|
||||||
with open(spec_filename) as f:
|
|
||||||
try:
|
|
||||||
spec_json = json.load(f)
|
|
||||||
except ValueError, ex:
|
|
||||||
print ex.message
|
|
||||||
match = re_error_location.search(ex.message)
|
|
||||||
if match:
|
|
||||||
line_number, column = int(match.group(1)), int(match.group(2))
|
|
||||||
print read_nth_line(f, line_number).rstrip()
|
|
||||||
print " " * (column - 1) + "^"
|
|
||||||
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
return spec_json
|
|
|
@ -1,177 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import os, sys, json
|
|
||||||
from common_paths import *
|
|
||||||
import spec_validator
|
|
||||||
import argparse
|
|
||||||
|
|
||||||
|
|
||||||
def expand_test_expansion_pattern(spec_test_expansion, test_expansion_schema):
|
|
||||||
expansion = {}
|
|
||||||
for artifact in spec_test_expansion:
|
|
||||||
artifact_value = spec_test_expansion[artifact]
|
|
||||||
if artifact_value == '*':
|
|
||||||
expansion[artifact] = test_expansion_schema[artifact]
|
|
||||||
elif isinstance(artifact_value, list):
|
|
||||||
expansion[artifact] = artifact_value
|
|
||||||
else:
|
|
||||||
expansion[artifact] = [artifact_value]
|
|
||||||
|
|
||||||
return expansion
|
|
||||||
|
|
||||||
|
|
||||||
def permute_expansion(expansion, selection = {}, artifact_index = 0):
|
|
||||||
artifact_order = ['delivery_method', 'redirection', 'origin',
|
|
||||||
'source_protocol', 'target_protocol', 'subresource',
|
|
||||||
'referrer_url', 'name']
|
|
||||||
|
|
||||||
if artifact_index >= len(artifact_order):
|
|
||||||
yield selection
|
|
||||||
return
|
|
||||||
|
|
||||||
artifact_key = artifact_order[artifact_index]
|
|
||||||
|
|
||||||
for artifact_value in expansion[artifact_key]:
|
|
||||||
selection[artifact_key] = artifact_value
|
|
||||||
for next_selection in permute_expansion(expansion,
|
|
||||||
selection,
|
|
||||||
artifact_index + 1):
|
|
||||||
yield next_selection
|
|
||||||
|
|
||||||
|
|
||||||
def generate_selection(selection, spec, subresource_path,
|
|
||||||
test_html_template_basename):
|
|
||||||
selection['spec_name'] = spec['name']
|
|
||||||
selection['spec_title'] = spec['title']
|
|
||||||
selection['spec_description'] = spec['description']
|
|
||||||
selection['spec_specification_url'] = spec['specification_url']
|
|
||||||
selection['subresource_path'] = subresource_path
|
|
||||||
# Oddball: it can be None, so in JS it's null.
|
|
||||||
selection['referrer_policy_json'] = json.dumps(spec['referrer_policy'])
|
|
||||||
|
|
||||||
test_filename = test_file_path_pattern % selection
|
|
||||||
test_directory = os.path.dirname(test_filename)
|
|
||||||
full_path = os.path.join(spec_directory, test_directory)
|
|
||||||
|
|
||||||
test_html_template = get_template(test_html_template_basename)
|
|
||||||
test_js_template = get_template("test.js.template")
|
|
||||||
disclaimer_template = get_template('disclaimer.template')
|
|
||||||
test_description_template = get_template("test_description.template")
|
|
||||||
|
|
||||||
html_template_filename = os.path.join(template_directory,
|
|
||||||
test_html_template_basename)
|
|
||||||
generated_disclaimer = disclaimer_template \
|
|
||||||
% {'generating_script_filename': os.path.relpath(__file__,
|
|
||||||
test_root_directory),
|
|
||||||
'html_template_filename': os.path.relpath(html_template_filename,
|
|
||||||
test_root_directory)}
|
|
||||||
|
|
||||||
# Adjust the template for the test invoking JS. Indent it to look nice.
|
|
||||||
selection['generated_disclaimer'] = generated_disclaimer.rstrip()
|
|
||||||
test_description_template = \
|
|
||||||
test_description_template.rstrip().replace("\n", "\n" + " " * 33)
|
|
||||||
selection['test_description'] = test_description_template % selection
|
|
||||||
|
|
||||||
# Adjust the template for the test invoking JS. Indent it to look nice.
|
|
||||||
indent = "\n" + " " * 6;
|
|
||||||
test_js_template = indent + test_js_template.replace("\n", indent);
|
|
||||||
selection['test_js'] = test_js_template % selection
|
|
||||||
|
|
||||||
# Directory for the test files.
|
|
||||||
try:
|
|
||||||
os.makedirs(full_path)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
selection['meta_delivery_method'] = ''
|
|
||||||
|
|
||||||
if spec['referrer_policy'] != None:
|
|
||||||
if selection['delivery_method'] == 'meta-referrer':
|
|
||||||
selection['meta_delivery_method'] = \
|
|
||||||
'<meta name="referrer" content="%(referrer_policy)s">' % spec
|
|
||||||
elif selection['delivery_method'] == 'meta-csp':
|
|
||||||
selection['meta_delivery_method'] = \
|
|
||||||
'<meta http-equiv="Content-Security-Policy" ' + \
|
|
||||||
'content="referrer %(referrer_policy)s">' % spec
|
|
||||||
elif selection['delivery_method'] == 'http-rp':
|
|
||||||
selection['meta_delivery_method'] = \
|
|
||||||
'<!-- No meta: Referrer policy delivered via HTTP headers. -->' \
|
|
||||||
'<meta name="http-referrer-policy" content="%(referrer_policy)s">' % spec
|
|
||||||
test_headers_filename = test_filename + ".headers"
|
|
||||||
with open(test_headers_filename, "w") as f:
|
|
||||||
f.write('Referrer-Policy: ' + \
|
|
||||||
'%(referrer_policy)s\n' % spec)
|
|
||||||
# TODO(kristijanburnik): Limit to WPT origins.
|
|
||||||
f.write('Access-Control-Allow-Origin: *\n')
|
|
||||||
elif selection['delivery_method'] == 'attr-referrer':
|
|
||||||
# attr-referrer is supported by the JS test wrapper.
|
|
||||||
pass
|
|
||||||
elif selection['delivery_method'] == 'rel-noreferrer':
|
|
||||||
# rel=noreferrer is supported by the JS test wrapper.
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise ValueError('Not implemented delivery_method: ' \
|
|
||||||
+ selection['delivery_method'])
|
|
||||||
|
|
||||||
# Obey the lint and pretty format.
|
|
||||||
if len(selection['meta_delivery_method']) > 0:
|
|
||||||
selection['meta_delivery_method'] = "\n " + \
|
|
||||||
selection['meta_delivery_method']
|
|
||||||
|
|
||||||
with open(test_filename, 'w') as f:
|
|
||||||
f.write(test_html_template % selection)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_test_source_files(spec_json, target):
|
|
||||||
test_expansion_schema = spec_json['test_expansion_schema']
|
|
||||||
specification = spec_json['specification']
|
|
||||||
|
|
||||||
spec_json_js_template = get_template('spec_json.js.template')
|
|
||||||
with open(generated_spec_json_filename, 'w') as f:
|
|
||||||
f.write(spec_json_js_template
|
|
||||||
% {'spec_json': json.dumps(spec_json)})
|
|
||||||
|
|
||||||
# Choose a debug/release template depending on the target.
|
|
||||||
html_template = "test.%s.html.template" % target
|
|
||||||
|
|
||||||
# Create list of excluded tests.
|
|
||||||
exclusion_dict = {}
|
|
||||||
for excluded_pattern in spec_json['excluded_tests']:
|
|
||||||
excluded_expansion = \
|
|
||||||
expand_test_expansion_pattern(excluded_pattern,
|
|
||||||
test_expansion_schema)
|
|
||||||
for excluded_selection in permute_expansion(excluded_expansion):
|
|
||||||
excluded_selection_path = selection_pattern % excluded_selection
|
|
||||||
exclusion_dict[excluded_selection_path] = True
|
|
||||||
|
|
||||||
for spec in specification:
|
|
||||||
for spec_test_expansion in spec['test_expansion']:
|
|
||||||
expansion = expand_test_expansion_pattern(spec_test_expansion,
|
|
||||||
test_expansion_schema)
|
|
||||||
for selection in permute_expansion(expansion):
|
|
||||||
selection_path = selection_pattern % selection
|
|
||||||
if not selection_path in exclusion_dict:
|
|
||||||
subresource_path = \
|
|
||||||
spec_json["subresource_path"][selection["subresource"]]
|
|
||||||
generate_selection(selection,
|
|
||||||
spec,
|
|
||||||
subresource_path,
|
|
||||||
html_template)
|
|
||||||
else:
|
|
||||||
print 'Excluding selection:', selection_path
|
|
||||||
|
|
||||||
|
|
||||||
def main(target):
|
|
||||||
spec_json = load_spec_json();
|
|
||||||
spec_validator.assert_valid_spec_json(spec_json)
|
|
||||||
generate_test_source_files(spec_json, target)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
parser = argparse.ArgumentParser(description='Test suite generator utility')
|
|
||||||
parser.add_argument('-t', '--target', type = str,
|
|
||||||
choices = ("release", "debug"), default = "release",
|
|
||||||
help = 'Sets the appropriate template for generating tests')
|
|
||||||
# TODO(kristijanburnik): Add option for the spec_json file.
|
|
||||||
args = parser.parse_args()
|
|
||||||
main(args.target)
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
||||||
python $DIR/clean.py && python $DIR/generate.py
|
|
|
@ -1,166 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import json, sys
|
|
||||||
from common_paths import *
|
|
||||||
|
|
||||||
def assert_non_empty_string(obj, field):
|
|
||||||
assert field in obj, 'Missing field "%s"' % field
|
|
||||||
assert isinstance(obj[field], basestring), \
|
|
||||||
'Field "%s" must be a string' % field
|
|
||||||
assert len(obj[field]) > 0, 'Field "%s" must not be empty' % field
|
|
||||||
|
|
||||||
def assert_non_empty_list(obj, field):
|
|
||||||
assert isinstance(obj[field], list), \
|
|
||||||
'%s must be a list' % field
|
|
||||||
assert len(obj[field]) > 0, \
|
|
||||||
'%s list must not be empty' % field
|
|
||||||
|
|
||||||
def assert_non_empty_dict(obj, field):
|
|
||||||
assert isinstance(obj[field], dict), \
|
|
||||||
'%s must be a dict' % field
|
|
||||||
assert len(obj[field]) > 0, \
|
|
||||||
'%s dict must not be empty' % field
|
|
||||||
|
|
||||||
def assert_contains(obj, field):
|
|
||||||
assert field in obj, 'Must contain field "%s"' % field
|
|
||||||
|
|
||||||
def assert_value_from(obj, field, items):
|
|
||||||
assert obj[field] in items, \
|
|
||||||
'Field "%s" must be from: %s' % (field, str(items))
|
|
||||||
|
|
||||||
def assert_atom_or_list_items_from(obj, field, items):
|
|
||||||
if isinstance(obj[field], basestring) or isinstance(obj[field], int):
|
|
||||||
assert_value_from(obj, field, items)
|
|
||||||
return
|
|
||||||
|
|
||||||
assert_non_empty_list(obj, field)
|
|
||||||
for allowed_value in obj[field]:
|
|
||||||
assert allowed_value != '*', "Wildcard is not supported for lists!"
|
|
||||||
assert allowed_value in items, \
|
|
||||||
'Field "%s" must be from: %s' % (field, str(items))
|
|
||||||
|
|
||||||
def assert_contains_only_fields(obj, expected_fields):
|
|
||||||
for expected_field in expected_fields:
|
|
||||||
assert_contains(obj, expected_field)
|
|
||||||
|
|
||||||
for actual_field in obj:
|
|
||||||
assert actual_field in expected_fields, \
|
|
||||||
'Unexpected field "%s".' % actual_field
|
|
||||||
|
|
||||||
def assert_value_unique_in(value, used_values):
|
|
||||||
assert value not in used_values, 'Duplicate value "%s"!' % str(value)
|
|
||||||
used_values[value] = True
|
|
||||||
|
|
||||||
|
|
||||||
def validate(spec_json, details):
|
|
||||||
""" Validates the json specification for generating tests. """
|
|
||||||
|
|
||||||
details['object'] = spec_json
|
|
||||||
assert_contains_only_fields(spec_json, ["specification",
|
|
||||||
"referrer_policy_schema",
|
|
||||||
"test_expansion_schema",
|
|
||||||
"subresource_path",
|
|
||||||
"excluded_tests"])
|
|
||||||
assert_non_empty_list(spec_json, "specification")
|
|
||||||
assert_non_empty_list(spec_json, "referrer_policy_schema")
|
|
||||||
assert_non_empty_dict(spec_json, "test_expansion_schema")
|
|
||||||
assert_non_empty_list(spec_json, "excluded_tests")
|
|
||||||
|
|
||||||
specification = spec_json['specification']
|
|
||||||
referrer_policy_schema = spec_json['referrer_policy_schema']
|
|
||||||
test_expansion_schema = spec_json['test_expansion_schema']
|
|
||||||
excluded_tests = spec_json['excluded_tests']
|
|
||||||
subresource_path = spec_json['subresource_path']
|
|
||||||
|
|
||||||
valid_test_expansion_fields = ['name'] + test_expansion_schema.keys()
|
|
||||||
|
|
||||||
# Validate each single spec.
|
|
||||||
for spec in specification:
|
|
||||||
details['object'] = spec
|
|
||||||
|
|
||||||
# Validate required fields for a single spec.
|
|
||||||
assert_contains_only_fields(spec, ['name',
|
|
||||||
'title',
|
|
||||||
'description',
|
|
||||||
'referrer_policy',
|
|
||||||
'specification_url',
|
|
||||||
'test_expansion'])
|
|
||||||
assert_non_empty_string(spec, 'name')
|
|
||||||
assert_non_empty_string(spec, 'title')
|
|
||||||
assert_non_empty_string(spec, 'description')
|
|
||||||
assert_non_empty_string(spec, 'specification_url')
|
|
||||||
assert_value_from(spec, 'referrer_policy', referrer_policy_schema)
|
|
||||||
assert_non_empty_list(spec, 'test_expansion')
|
|
||||||
|
|
||||||
# Validate spec's test expansion.
|
|
||||||
used_spec_names = {}
|
|
||||||
|
|
||||||
for spec_exp in spec['test_expansion']:
|
|
||||||
details['object'] = spec_exp
|
|
||||||
assert_non_empty_string(spec_exp, 'name')
|
|
||||||
# The name is unique in same expansion group.
|
|
||||||
assert_value_unique_in((spec_exp['expansion'], spec_exp['name']),
|
|
||||||
used_spec_names)
|
|
||||||
assert_contains_only_fields(spec_exp, valid_test_expansion_fields)
|
|
||||||
|
|
||||||
for artifact in test_expansion_schema:
|
|
||||||
details['test_expansion_field'] = artifact
|
|
||||||
assert_atom_or_list_items_from(
|
|
||||||
spec_exp, artifact, ['*'] + test_expansion_schema[artifact])
|
|
||||||
del details['test_expansion_field']
|
|
||||||
|
|
||||||
# Validate the test_expansion schema members.
|
|
||||||
details['object'] = test_expansion_schema
|
|
||||||
assert_contains_only_fields(test_expansion_schema, ['expansion',
|
|
||||||
'delivery_method',
|
|
||||||
'redirection',
|
|
||||||
'origin',
|
|
||||||
'source_protocol',
|
|
||||||
'target_protocol',
|
|
||||||
'subresource',
|
|
||||||
'referrer_url'])
|
|
||||||
# Validate excluded tests.
|
|
||||||
details['object'] = excluded_tests
|
|
||||||
for excluded_test_expansion in excluded_tests:
|
|
||||||
assert_contains_only_fields(excluded_test_expansion,
|
|
||||||
valid_test_expansion_fields)
|
|
||||||
details['object'] = excluded_test_expansion
|
|
||||||
for artifact in test_expansion_schema:
|
|
||||||
details['test_expansion_field'] = artifact
|
|
||||||
assert_atom_or_list_items_from(
|
|
||||||
excluded_test_expansion,
|
|
||||||
artifact,
|
|
||||||
['*'] + test_expansion_schema[artifact])
|
|
||||||
del details['test_expansion_field']
|
|
||||||
|
|
||||||
# Validate subresource paths.
|
|
||||||
details['object'] = subresource_path
|
|
||||||
assert_contains_only_fields(subresource_path,
|
|
||||||
test_expansion_schema['subresource']);
|
|
||||||
|
|
||||||
for subresource in subresource_path:
|
|
||||||
local_rel_path = "." + subresource_path[subresource]
|
|
||||||
full_path = os.path.join(test_root_directory, local_rel_path)
|
|
||||||
assert os.path.isfile(full_path), "%s is not an existing file" % path
|
|
||||||
|
|
||||||
del details['object']
|
|
||||||
|
|
||||||
|
|
||||||
def assert_valid_spec_json(spec_json):
|
|
||||||
error_details = {}
|
|
||||||
try:
|
|
||||||
validate(spec_json, error_details)
|
|
||||||
except AssertionError, err:
|
|
||||||
print 'ERROR:', err.message
|
|
||||||
print json.dumps(error_details, indent=4)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
spec_json = load_spec_json();
|
|
||||||
assert_valid_spec_json(spec_json)
|
|
||||||
print "Spec JSON is valid."
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the attr-referrer
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is same-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "attr-referrer",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "same-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an http
|
|
||||||
sub-resource via link-tag using the http-rp
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "http",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via a-tag using the http-rp
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "a-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/a-tag.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via iframe-tag using the http-rp
|
|
||||||
delivery method with swap-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "swap-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "iframe-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/document.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the http-rp
|
|
||||||
delivery method with keep-origin-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "keep-origin-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
|
|
||||||
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
|
|
||||||
<!-- No meta: Referrer policy delivered via HTTP headers. --><meta name="http-referrer-policy" content="no-referrer-when-downgrade">
|
|
||||||
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
|
|
||||||
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
|
|
||||||
<meta name="assert" content="The referrer URL is stripped-referrer when a
|
|
||||||
document served over http requires an https
|
|
||||||
sub-resource via link-tag using the http-rp
|
|
||||||
delivery method with no-redirect and when
|
|
||||||
the target request is cross-origin.">
|
|
||||||
<script src="/resources/testharness.js"></script>
|
|
||||||
<script src="/resources/testharnessreport.js"></script>
|
|
||||||
<!-- TODO(kristijanburnik): Minify and merge both: -->
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/common.js"></script>
|
|
||||||
<script src="/_mozilla/mozilla/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
ReferrerPolicyTestCase(
|
|
||||||
{
|
|
||||||
"referrer_policy": "no-referrer-when-downgrade",
|
|
||||||
"delivery_method": "http-rp",
|
|
||||||
"redirection": "no-redirect",
|
|
||||||
"origin": "cross-origin",
|
|
||||||
"source_protocol": "http",
|
|
||||||
"target_protocol": "https",
|
|
||||||
"subresource": "link-tag",
|
|
||||||
"subresource_path": "/_mozilla/mozilla/referrer-policy/generic/subresource/link.py",
|
|
||||||
"referrer_url": "stripped-referrer"
|
|
||||||
},
|
|
||||||
document.querySelector("meta[name=assert]").content,
|
|
||||||
new SanityChecker()
|
|
||||||
).start();
|
|
||||||
</script>
|
|
||||||
<div id="log"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Referrer-Policy: no-referrer-when-downgrade
|
|
||||||
Access-Control-Allow-Origin: *
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue