Commit 62878f45 authored by David Van Cleve's avatar David Van Cleve Committed by Commit Bot

Refactors and expands referrer policy browsertests

This patchset contains two changes to the referrer policy browsertests:

1. Refactor the "reduced referrer granularity flag" tests to use
a parameterized test---this will allow easy expansion to test additional
capping logic, e.g. the "no referrers at all" flag, which is currently
missing test coverage. (This will be remedied by a follow-on CL.)
2. Add tests for subresource requests (by registering a test
server callback to inspect the `Referer` headers sent along with
the requests).

R=jochen

Bug: 1004486
Change-Id: I9bc13fe536f04829e69ba0443c6d724ffb113750
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1842005
Commit-Queue: David Van Cleve <davidvc@chromium.org>
Reviewed-by: default avatarDominic Farolino <dom@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703444}
parent 34ac5bc4
<!DOCTYPE html>
<html>
<head>
<script>
function run() {
const kPolicy = 1;
const kRedirect = 2;
const re = new RegExp("policy=(.*)&redirect=(.*)");
const matches = re.exec(document.location.search);
if (matches == null) {
document.body.innerText = "Could not parse parameters!";
return;
}
if (matches[kPolicy] != "no-meta") {
const meta = document.createElement("meta");
meta.name = "referrer";
meta.content = matches[kPolicy];
document.head.appendChild(meta);
}
const destination = matches[kRedirect];
const image = document.createElement("img");
image.src = destination;
image.onload = function() { document.title = 'loaded'; };
}
</script>
</head>
<body onload="run()">
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment