Commit 90608d57 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Fix CSP frame-ancestors wpt tests.

These tests were broken by
https://github.com/web-platform-tests/wpt/commit/38be30e734ea5afcdc5801613f197d17d716674d.

Bug: 759184
Change-Id: I39a9bc3da1d5a955975ce35a3201613c4efba010
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776600Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691836}
parent a43cde17
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'none' should block rendering in nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'same' should block render in same-origin nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should block or allow rendering in nested frames as appropriate. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'none' should block rendering in nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'same' should block render in same-origin nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value '*' should render in nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should block or allow rendering in nested frames as appropriate. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should block or allow rendering in nested frames as appropriate. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should compare against each frame's origin rather than URL, so a nested frame with a sandboxed parent frame should be blocked due to the parent having a unique origin. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'none' should block rendering in nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'same' should block render in same-origin nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should block or allow rendering in nested frames as appropriate. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'none' should block rendering in nested frames. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL value should block or allow rendering in nested frames as appropriate. assert_unreached: Inner IFrame msg: undefined Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'none' should block rendering. assert_unreached: The IFrame should have been blocked (or cross-origin). It wasn't. Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a value 'self' should block rendering. assert_unreached: The IFrame should have been blocked (or cross-origin). It wasn't. Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with '*' should allow rendering. assert_unreached: The IFrame should have been blocked (or cross-origin). It wasn't. Reached unreachable code
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL A 'frame-ancestors' CSP directive with a URL which doesn't match this origin should be blocked. assert_unreached: The IFrame should have been blocked (or cross-origin). It wasn't. Reached unreachable code
Harness: the test ran to completion.
...@@ -26,7 +26,7 @@ window.addEventListener("message", function (e) { ...@@ -26,7 +26,7 @@ window.addEventListener("message", function (e) {
window.parent.postMessage(e.data, "*"); window.parent.postMessage(e.data, "*");
else else
if (e.data.type === 'test_result') if (e.data.type === 'test_result')
endTest(e.data.failed, "Inner IFrame msg: " + e.data.msg); endTest(e.data.failed, "Inner IFrame msg: " + e.data.message);
}); });
function injectNestedIframe(policy, parent, child, expectation, isSandboxed) { function injectNestedIframe(policy, parent, child, expectation, isSandboxed) {
...@@ -67,6 +67,7 @@ function iframeLoaded(expectBlock) { ...@@ -67,6 +67,7 @@ function iframeLoaded(expectBlock) {
var failed = true; var failed = true;
var message = ""; var message = "";
try { try {
ev.target.contentWindow.location.href;
if (expectBlock) { if (expectBlock) {
message = "The IFrame should have been blocked (or cross-origin). It wasn't."; message = "The IFrame should have been blocked (or cross-origin). It wasn't.";
failed = true; failed = true;
......
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