-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mistakes in trusted-types*reporting tests. #50098
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ | |
<script src="/content-security-policy/support/testharness-helper.js"></script> | ||
</head> | ||
<body> | ||
<!-- Some elements for the tests to act on. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this cause a problem when running them? LGTM either way, just trying to understand the why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I noticed some flakiness in firefox after implementing svg href due to that. actually it seems there used to be a flakiness in chromium too (will remove that comment) |
||
<div id="div"></div> | ||
<script id="script"></script> | ||
<script id="customscript" is="custom-script" src="a"></script> | ||
<svg><script id="svgscript"></script></svg> | ||
<script> | ||
// CSP insists the "trusted-types: ..." directives are delivered as headers | ||
// (rather than as "<meta http-equiv" tags). This test assumes the following | ||
|
@@ -52,7 +57,8 @@ | |
// Like assert_throws_*, but we don't care about the exact error. We just want | ||
// to run the code and continue. | ||
function expect_throws(fn) { | ||
try { fn(); assert_unreached(); } catch (err) { /* ignore */ } | ||
try { fn(); } catch (err) { return; /* ignore */ } | ||
assert_unreached(); | ||
} | ||
|
||
// Test the "sample" field of the event. | ||
|
@@ -198,9 +204,6 @@ | |
return p; | ||
}, "Trusted Type violation report: sample for script innerText assignment"); | ||
|
||
// TODO(lyf): https://crbug.com/1066791 Following tests which related to svg | ||
// script element cause a flaky timeout in `linux-blink-rel`, following tests | ||
// should be added back after the bug fix. | ||
promise_test(t => { | ||
let p = Promise.resolve() | ||
.then(promise_violation("require-trusted-types-for 'script'")) | ||
|
@@ -281,10 +284,4 @@ | |
}, "Trusted Type violation report: Worker constructor"); | ||
|
||
</script> | ||
|
||
<!-- Some elements for the tests to act on. --> | ||
<div id="div"></div> | ||
<script id="script"></script> | ||
<script id="customscript" is="custom-script" src="a"></script> | ||
<svg><script id="svgscript"></script></svg> | ||
</body> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current behavior is broken, see commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah apologies yeah that makes sense.