Skip to content
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

Test some more edge cases for X-Frame-Options #24618

Merged
merged 15 commits into from
Aug 18, 2020
Merged

Test some more edge cases for X-Frame-Options #24618

merged 15 commits into from
Aug 18, 2020

Conversation

domenic
Copy link
Member

@domenic domenic commented Jul 15, 2020

Follows whatwg/html#5737.

Copy link
Member

@mikewest mikewest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % nits. Thanks!

It might be reasonable to add tests for <embed> as well if we don't already have them.

x-frame-options/invalid.sub.html Outdated Show resolved Hide resolved
x-frame-options/invalid.sub.html Outdated Show resolved Hide resolved
x-frame-options/invalid.sub.html Outdated Show resolved Hide resolved
x-frame-options/invalid.sub.html Outdated Show resolved Hide resolved
@annevk
Copy link
Member

annevk commented Jul 17, 2020

See also #21730.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 July 28, 2020 13:00 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 5, 2020 16:26 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 5, 2020 17:18 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 5, 2020 17:25 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 5, 2020 17:33 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 5, 2020 17:41 Inactive
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great. One thing that is somewhat hard to review is that

Header: Value,Value2

and

Header: Value
Header: Value2

are expected to have identical results.

Could we perhaps generate the former from the data for the latter? And if the problem is that this would result in too many tests we could use variants I suppose.

Edit: Mike's remark about embed (which also goes for object) is worth noting in the README at least as a TODO.

}
case "no message": {
waitForMessageFrom(i, t).then(t.unreached_func("Frame should not have sent a message."));
i.onload = t.step_func_done(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect a problem here is that Firefox does not dispatch the load event for (all) network errors. See also whatwg/html#125 (and references to that in other tests). If initially i.contentDocument was available as I suspect it would be given initial about:blank, you could wait for it to not be available using step_wait and friends.

@domenic
Copy link
Member Author

domenic commented Aug 6, 2020

I've made it generate comma variants from multi-header variants, and also removed the need to specify both orders. (If headerValue and headerValue2 are different, then it will also generate tests for what happens when you swap them.) The end result is that multiple.html contains 42 tests; that doesn't seem so bad.

I'll leave embed/object and any Firefox workarounds for a future PR.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-24618 August 6, 2020 14:18 Inactive
@domenic
Copy link
Member Author

domenic commented Aug 6, 2020

Should we merge this ahead of the spec PR, since it increases coverage? Or should we wait until we settle on what to do for conflicts?

@annevk
Copy link
Member

annevk commented Aug 18, 2020

I think ideally we merge this when we merge the specification text and file impl bugs.

@domenic domenic merged commit 29c58c0 into master Aug 18, 2020
@domenic domenic deleted the moar-xfo-tests branch August 18, 2020 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants