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_driver.click(button) doesn't work in iframes #20282
Comments
#17260 should have made it work, I thought. Maybe it doesn't, maybe we regressed it. :( |
@gsnedders We're hitting this line: Line 99 in bdad828
|
And I tried removing that line, but it then causes timeouts—presumably from missing buttons?
They used to pass before we added user gesture in Firefox. |
Well that doesn't seem very useful. We should fix this more usefully. 🙃 |
In https://chromium-review.googlesource.com/c/chromium/src/+/2283968/14/third_party/blink/web_tests/external/wpt/resources/chromium/webxr-test.js there's a workaround for this issue, making the setup non-cross-browser. That seems unfortunate. @stephenmcgruer have you come across other tests working around this? I'm wondering if we might have accumulated enough cases to make this worth prioritizing. |
FWIW, I had copied this non-cross-browser setup from Chromium's web_tests/fullscreen/trusted-click.js, it's used by several fullscreen tests there. It looks as if these correspond to multiple manual fullscreen tests in WPT. |
Correction, my workaround was based on a simplified version that just uses eventSender to click at coordinates (0, 0) which was good enough for this specific use case. A more general solution would get more complicated if it needs to calculate specific coordinates for elements, especially since AFAIK a cross-origin iframe can't portably determine its position within the parent. The Chromium trusted_click function takes a clickRectInRootFrameCoordinate argument to explicitly pass this in. (I had experimented with using sendMessage to store the iframe position in an ad-hoc window property that can be read by simulateUserActivation, but that seems rather hackish.) |
This came up in discussion with @jgraham today too. It seems like at some point some support was added specifically for actions in I may be over-looking something important, but it seems like we could just naively do a switch-to-frame, do-command, switch-back approach for every testdriver.js interaction and that would work? Would need some investigation and debugging to prove it out. |
Yes, I think for frames that would work. For windows it's a bit more complex because currently it's a pain to get the window handle for a given dom window (WebDriver supports this but implementations don't). It's also a pain to start an interaction from outside the main window; if we want to support that we'll probably need some API surface for postMessaging actions up to the main window. |
And as @jgraham pointed out on IRC, |
This is now fixed for all cases where the test window and window where the interaction is taking place can get handles to each other (i.e. excluding rel=noopener and similar). |
The awesome user gesture automation tool
test_driver.click()
added in #6897, unfortunately doesn't work in iframes, which blocks us from testing the "display-capture" feature-policy, because getDisplayMedia requires user activation.cc @gsnedders @jgraham
The text was updated successfully, but these errors were encountered: