| Index: LayoutTests/http/tests/security/referrer-policy-attribute-iframe.html
|
| diff --git a/LayoutTests/http/tests/security/referrer-policy-attribute-iframe.html b/LayoutTests/http/tests/security/referrer-policy-attribute-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c6edf6038bbe43750dee9a33c38c0a8637924b50
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/security/referrer-policy-attribute-iframe.html
|
| @@ -0,0 +1,64 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| + <head>
|
| + <script src="/resources/testharness.js"></script>
|
| + <script src="/resources/testharnessreport.js"></script>
|
| + </head>
|
| + <body>
|
| + <meta name="referrer" content="origin">
|
| + <script>
|
| + async_test(function () {
|
| + window.onmessage = this.step_func(function (event) {
|
| + if (event.data.policy === "no-referrer") {
|
| + assert_equals(event.data.referrer, "");
|
| + this.done();
|
| + }
|
| + });
|
| + }, "no-referrer attribute on iframe");
|
| + </script>
|
| +
|
| + <iframe src="resources/referrer-attr-iframe-target.html#no-referrer"
|
| + referrerpolicy="no-referrer" />
|
| +
|
| + <script>
|
| + async_test(function () {
|
| + window.onmessage = this.step_func(function (event) {
|
| + if (event.data.policy === "origin-when-crossorigin") {
|
| + assert_equals(event.data.referrer, "http://127.0.0.1:8000/");
|
| + this.done();
|
| + }
|
| + });
|
| + }, "origin-when-crossorigin referrerpolicy attribute on iframe");
|
| + </script>
|
| +
|
| + <iframe src="resources/referrer-attr-iframe-target.html#origin-when-crossorigin"
|
| + referrerpolicy="origin-when-crossorigin" />
|
| +
|
| + <script>
|
| + async_test(function () {
|
| + window.onmessage = this.step_func(function (event) {
|
| + if (event.data.policy === "origin") {
|
| + assert_equals(event.data.referrer, "http://127.0.0.1:8000/");
|
| + this.done();
|
| + }
|
| + });
|
| + }, "origin referrerpolicy attribute on iframe");
|
| + </script>
|
| +
|
| + <iframe src="resources/referrer-attr-iframe-target.html#origin"
|
| + referrerpolicy="origin" />
|
| +
|
| + <script>
|
| + async_test(function () {
|
| + window.onmessage = this.step_func(function (event) {
|
| + if (event.data.policy === "unsafe-url") {
|
| + assert_equals(event.data.referrer, "http://127.0.0.1:8000/security/referrer-policy-attribute-iframe.html");
|
| + this.done();
|
| + }
|
| + });
|
| + }, "unsafe-url referrerpolicy attribute on iframe");
|
| + </script>
|
| +
|
| + <iframe src="http://localhost:8000/security/resources/referrer-attr-iframe-target.html#unsafe-url" referrerpolicy="unsafe-url" />
|
| +</body>
|
| +</html>
|
|
|