Skip to content

[html] Update COOP tests#20874

Merged
zcorpan merged 12 commits intoweb-platform-tests:masterfrom
bocoup:html-coop-update-2
Jan 8, 2020
Merged

[html] Update COOP tests#20874
zcorpan merged 12 commits intoweb-platform-tests:masterfrom
bocoup:html-coop-update-2

Conversation

@jugglinmike
Copy link
Contributor

The possible values of the Cross-Origin-Opener-Policy header have
changed since these tests were authored:

  • same-origin unsafe-allow-outgoing is now same-origin-allow-popups
  • same-site and same-site unsafe-allow-outgoing have been removed
    and no equivalent value is available

Reflect these changes in the relevant tests. Introduce cases for the
removed values to ensure that they are no longer honored.

Introduce new test cases covering when the default value is specified explicitly.

The possible values of the `Cross-Origin-Opener-Policy` header have
changed since these tests were authored:

- `same-origin unsafe-allow-outgoing` is now `same-origin-allow-popups`
- `same-site` and `same-site unsafe-allow-outgoing` have been removed
  and no equivalent value is available

Reflect these changes in the relevant tests. Introduce cases for the
removed values to ensure that they are no longer honored.
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.

Thank you so much for starting this!

@annevk
Copy link
Member

annevk commented Jan 6, 2020

@hemeryar
Copy link
Contributor

hemeryar commented Jan 7, 2020

Hi Mike, I imagine you went on vacations for the past weeks. Are you still actively planning to land this patch? I'll just drop mine if that is the case, since it's pretty much a duplicate.

@zcorpan
Copy link
Member

zcorpan commented Jan 7, 2020

@hemeryar I'm planning to work on this PR this week.

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.

Highlighted the other boolean flip I was worried about. I think other than that this is probably fine, though it would help a lot if @hemeryar et al. verified with Chrome's implementation.

Another thing we should look into is whether we can reduce the number of step_timeout calls as they are really problematic for CI.

// navigate that to either a same-origin or same-site document whose COOP and COEP are set as
// per the top-most array. We then verify that this document has the correct opener for its
// specific setup.
// navigate that to either a document with same origin (site=="same-origin") or
Copy link
Member

Choose a reason for hiding this comment

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

I think the original sentence might be clearer, but adding the parentheticals might be even better. This sentence however reads a little strange.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed.

@annevk
Copy link
Member

annevk commented Jan 7, 2020

@ParisMeuleman @hemeryar any further thoughts here?

t.add_cleanup(() => {
popup.close();
});
window.functionCalledByOpenee = () => {
Copy link
Member

Choose a reason for hiding this comment

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

This should use 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.

Oops, yes. Fixed.

@zcorpan
Copy link
Member

zcorpan commented Jan 7, 2020

In the "wpt-firefox-nightly-stability" check /html/cross-origin-opener-policy/historical/popup-same-site.https.html and /html/cross-origin-opener-policy/popup-same-origin.https.html sometimes time out, leading to unstable results. Should we treat this as a bug in Firefox, or should the tests be split up more?

@annevk
Copy link
Member

annevk commented Jan 7, 2020

Probably split them if you can as that seems unlikely to be fixed on the infrastructure side.

@zcorpan
Copy link
Member

zcorpan commented Jan 7, 2020

Done.

These tests have some repetition. A script to generate them could make them easier to maintain.

@hemeryar
Copy link
Contributor

hemeryar commented Jan 8, 2020

Pulled the changes locally and ran the tests, everything seems to work fine on chromium. Only difference I could spot with Firefox (that already exists) is in:
html/cross-origin-opener-policy/resources/postback.html
For the sandboxing test, chromium blocks the iframe closing its parent because of sandboxing rules missing "allow-top-navigation". In both chromium and firefox this is denied afterwards as "A frame cannot close its parent" or something like that. I'd say just remove that line.

@hemeryar
Copy link
Contributor

hemeryar commented Jan 8, 2020

The rest looks great, thanks for the work!

@zcorpan zcorpan requested a review from annevk January 8, 2020 14:28
@zcorpan
Copy link
Member

zcorpan commented Jan 8, 2020

Thank you, @hemeryar!

I think we should merge this, and do the close() in postback.html change in a follow-up.

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.

Worksforme.

@zcorpan
Copy link
Member

zcorpan commented Jan 8, 2020

By the way, @hemeryar, would you like to be in the wpt reviewers team (so you can approve and merge PRs), and be listed as a suggested_reviewer to get notified about PRs in html/cross-origin-resources-policy?

@zcorpan zcorpan merged commit a1e7a4e into web-platform-tests:master Jan 8, 2020
@zcorpan zcorpan deleted the html-coop-update-2 branch January 8, 2020 14:40
@hemeryar
Copy link
Contributor

hemeryar commented Jan 8, 2020

Sure! Could you also add @ParisMeuleman who is working with me on COOP for chromium?

@zcorpan zcorpan mentioned this pull request Jan 8, 2020
@zcorpan
Copy link
Member

zcorpan commented Jan 8, 2020

Certainly! I've invited you both. If accepting the invite caused you to watch this repo, you probably want to unwatch it. See https://github.com/orgs/web-platform-tests/teams/reviewers for details. There is also documentation available for reviewing tests.

I've updated #20843

Thanks!

zcorpan added a commit to bocoup/wpt that referenced this pull request Jan 10, 2020
@ArthurSonzogni
Copy link
Member

I am surprised by the rename:
html/cross-origin-opener-policy/popup-same-origin.https.html.headers →
html/cross-origin-opener-policy/popup-meta-http-equiv.https.html.headers

We shouldn't define an HTTP header for this test. It already defines an HTML "meta" COOP header. The test check it isn't supported.

FYI: @ParisMeuleman, @hemeryar
I think we should probably delete this file.

@zcorpan
Copy link
Member

zcorpan commented Jan 20, 2020

@ArthurSonzogni good catch! I probably had that file for testing and accidentally added it here. Sorry about that. I can delete it in a new PR.

zcorpan added a commit that referenced this pull request Jan 20, 2020
This file was accidentally added in #20874.
The test was added in #20875 but it should not have a .headers file
since it's testing that `<meta>` has no effect.
@ParisMeuleman
Copy link
Contributor

I am surprised by the rename:
html/cross-origin-opener-policy/popup-same-origin.https.html.headers →
html/cross-origin-opener-policy/popup-meta-http-equiv.https.html.headers

We shouldn't define an HTTP header for this test. It already defines an HTML "meta" COOP header. The test check it isn't supported.

FYI: @ParisMeuleman, @hemeryar
I think we should probably delete this file.

Indeed, it would explain the failure @hemeryar got in https://crrev.com/c/1985013/16/third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/popup-meta-http-equiv.https-expected.txt#2

zcorpan added a commit that referenced this pull request Jan 20, 2020
This file was accidentally added in #20874.
The test was added in #20875 but it should not have a .headers file
since it's testing that `<meta>` has no effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants