web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.89k stars 3.06k forks source link

Add ability to test with popup blocker enabled #3867

Open zcorpan opened 7 years ago

zcorpan commented 7 years ago

See https://github.com/whatwg/html/pull/1854

It would be good to be able to somehow test the behavior of window.open with the popup blocker enabled (not just for the return value, but also to test when the popup is being blocked, for cases that don't need to be manual).

annevk commented 7 years ago

This is also a problem for https://github.com/whatwg/html/issues/2616.

cc @jugglinmike

foolip commented 6 years ago

I'm labeling this as backlog (the lowest priority) because it seems like this will not affect any whole features, but rather a handful of cases spread around the platform. @JKereliuk, this might require some WebDriver APIs. If you're tracking feature requests somewhere, can you add this there?

kereliuk commented 6 years ago

@foolip +1 :)

kereliuk commented 6 years ago

Are there any existing manual tests that need this?

annevk commented 6 years ago

There's examples linked in the issues above that could easily be turned into tests.

foolip commented 6 years ago

@jstenback ran into this with https://wpt.fyi/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-width.html, which fails on Edge and Safari because of the popup blocker, at least it seems like that in my manual testing.

@kereliuk, do you know if ChromeDriver implicitly disables the popup blocker, or why this passes in Chrome?

annevk commented 6 years ago

You need to disable the popup blocker to use web-platform-tests. That's why this issue is asking for the opposite.

mustaqahmed commented 6 years ago

This is blocking tests for User Activation v2 consumption behavior: disabled popup blocker means activation consumption is invisible to the page.

foolip commented 6 years ago

Thanks for reporting @mustaqahmed. Multiple teams are now using https://web-platform-tests.org/writing-tests/testdriver-tutorial.html to add their own testing APIs end-to-end, with help from @kereliuk. As you're implementing User Activation v2, is this an issue you'd consider owning? I believe the WebDriver extension API, if that makes sense, would have to go in either HTML or a standalone extension spec.

How are you testing this internally, in LayoutTests? Is there an internals.something() API that you use?

zcorpan commented 1 month ago

This is also a problem for full test coverage for https://github.com/whatwg/html/pull/10547