Commit ecd91676 authored by Andy Paicu's avatar Andy Paicu Committed by Commit Bot

'navigate-to' directive tests

PR: https://github.com/w3c/webappsec-csp/pull/290

Bug: 805886
Change-Id: I5bdda65c7e70e729b33a3647135fee6453e97e66
Reviewed-on: https://chromium-review.googlesource.com/934181
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541769}
parent d79a4e51
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<a name="anchor"></a>
<script>
var t = async_test("Test that anchor navigation is allowed regardless of the `navigate-to` directive");
window.addEventListener('securitypolicyviolation', t.unreached_func("Should not have triggered any violation"));
try {
window.location.hash = "anchor";
t.done();
} catch(ex) {}
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: navigate-to 'none'
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child can navigate the parent because the relevant policy belongs to the navigation initiator (in this case the child)");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe srcdoc="<iframe src='support/navigate_parent.sub.html?csp=navigate-to%20%27self%27'>">
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: navigate-to support/navigate_parent.sub.html
This is a testharness.js-based test.
FAIL Test that the child can't navigate the parent because the relevant policy belongs to the navigation initiator (in this case the child) assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child can't navigate the parent because the relevant policy belongs to the navigation initiator (in this case the child)");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe srcdoc="<iframe src='support/navigate_parent.sub.html?csp=navigate-to%20%27none%27'>">
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: navigate-to 'self'
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that form-action overrides navigate-to when present.");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="../support/form_action_navigation.sub.html?csp=navigate-to%20%27self%27%3B%20form-action%20%27self%27%3B&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that form-action overrides navigate-to when present.");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="../support/form_action_navigation.sub.html?csp=navigate-to%20%27none%27%3B%20form-action%20%27self%27%3B&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that form-action overrides navigate-to when present.");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'form-action');
});
</script>
<iframe src="../support/form_action_navigation.sub.html?csp=navigate-to%20%27self%27%3B%20form-action%20%27none%27%3B&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that form-action overrides navigate-to when present.");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'form-action');
});
</script>
<iframe src="../support/form_action_navigation.sub.html?csp=navigate-to%20%27none%27%3B%20form-action%20%27none%27%3B&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20%27self%27&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20%27none%27&action=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}&action=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20%27self%27&action=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20%27self%27&action=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/form_action_navigation.sub.html?csp=navigate-to%20{{location[server]}}/content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py&action=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20%27self%27&target=post_message_to_frame_owner.html", "_blank");
</script>
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20%27none%27&target=post_message_to_frame_owner.html", "_blank");
</script>
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html", "_blank");
</script>
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20%27self%27&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html", "_blank");
</script>
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20%27self%27&target=redirect_to_post_message_to_frame_owner.py", "_blank");
</script>
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
window.open("support/href_location_navigation.sub.html?csp=navigate-to%20{{location[server]}}/content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py&target=redirect_to_post_message_to_frame_owner.py", "_blank");
</script>
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20%27self%27&target=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20%27none%27&target=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20%27self%27&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20%27self%27&target=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/link_click_navigation.sub.html?csp=navigate-to%20{{location[server]}}/content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py&target=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20%27self%27&target=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20%27none%27&target=post_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20%27self%27&target=http%3A%2F%2F{{domains[www1]}}:{{ports[http][0]}}%2Fcontent-security-policy%2Fnavigate-to%2Fsupport%2Fpost_message_to_frame_owner.html">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is allowed");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20%27self%27&target=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
This is a testharness.js-based test.
FAIL Test that the child iframe navigation is blocked assert_equals: expected "fail" but got "success"
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the child iframe navigation is blocked");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'fail');
assert_equals(e.data.violatedDirective, 'navigate-to');
});
</script>
<iframe src="support/meta_refresh_navigation.sub.html?csp=navigate-to%20{{location[server]}}/content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py&target=redirect_to_post_message_to_frame_owner.py">
</body>
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the parent can navigate the child because the relevant policy belongs to the navigation initiator (in this case the parent)");
window.onmessage = t.step_func_done(function(e) {
assert_equals(e.data.result, 'success');
});
window.addEventListener('securitypolicyviolation', t.unreached_func("Should not have triggered a policy violation"));
var i = document.createElement('iframe');
var src_changed = false;
i.onload = function() {
if (src_changed) return;
src_changed = true;
i.src = "support/post_message_to_frame_owner.html";
}
i.src = "support/wait_for_navigation.html?csp=navigate-to%20%none%27";
document.body.appendChild(i);
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: navigate-to 'self'
This is a testharness.js-based test.
FAIL Test that the parent can't navigate the child because the relevant policy belongs to the navigation initiator (in this case the parent) assert_unreached: Should not have received a message from the child Reached unreachable code
Harness: the test ran to completion.
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var t = async_test("Test that the parent can't navigate the child because the relevant policy belongs to the navigation initiator (in this case the parent)");
window.addEventListener('securitypolicyviolation', t.step_func_done(function(e) {
assert_equals(e.violatedDirective, 'navigate-to');
}));
window.onmessage = t.unreached_func("Should not have received a message from the child");
var i = document.createElement('iframe');
var src_changed = false;
i.onload = function() {
if (src_changed) return;
src_changed = true;
i.src = "support/post_message_to_frame_owner.html";
}
i.src = "support/wait_for_navigation.html?csp=navigate-to%20%self%27";
document.body.appendChild(i);
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: navigate-to support/wait_for_navigation.html
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
</head>
<body>
<form action='{{GET[action]}}' target='_self' id='form'>
<input type="text" name="dummy">
</form>
<script>
document.getElementById('form').submit();
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
window.opener.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
</head>
<body>
<script>
try {
location.href = "{{GET[target]}}";
} catch(ex) {}
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
</head>
<body>
<a href="{{GET[target]}}" id="link">dummy link</a>
<script>
document.getElementById('link').click();
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
<meta http-equiv="refresh" content="1; url={{GET[target]}}">
</head>
<body>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
</head>
<body>
<a href="post_message_to_frame_owner.html" id="link" target="_parent">dummy link</a>
<script>
document.getElementById('link').click();
</script>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
<script>
if (window.opener)
window.opener.postMessage({result: 'success'}, '*');
else
top.postMessage({result: 'success'}, '*');
</script>
\ No newline at end of file
def main(request, response):
response.status = 302
response.headers.set("Location", "post_message_to_frame_owner.html")
\ No newline at end of file
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
top.postMessage({result: 'fail', violatedDirective: e.violatedDirective}, '*');
});
</script>
</head>
<body>
</body>
\ No newline at end of file
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Security-Policy: {{GET[csp]}}
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