wpt
wpt copied to clipboard
Clipboard API: use bless() instead
Replaces waitForUserActivation() for test_driver.bless(). They functionally do the same thing, but bless is better for devices where an actual clickable thing needs to be activated.
@marcoscaceres looking at the test results here, it looks like 3 tests have gone missing: https://wpt.fyi/results/clipboard-apis?diff&filter=ADC&run_id=5200303578677248&run_id=4800456115617792
The same can be seen for Chrome and Firefox. Can you check what might be going on with this?
Let's see if the strange missing tests situation corrects itself... not sure why that would happen.
@saschanaz, hopefully better now 🙈
Hehe, I like letting the bots do the work🤖 will check, don’t worry.
(You might want to keep the load event listener inside the current waitForUserActivation?)
Why not just replace the implementation of waitForUserActivation() with a call to test_driver.bless()?
waitForUserActivation is far more readable in the test - how many people know that test_driver.bless() means the test waits for user activation? I know I wasn't aware of that.
See also saschanaz's comment, since keeping waitForUserActivation would make it easier to keep the 'load' listener, and also add workarounds if in the future we find a scenario where bless() doesn't quite do what we need.
Why not just replace the implementation of waitForUserActivation() with a call to test_driver.bless()?
That adds additional layers of indirection: test ➡️ user-activation.js ➡️ test_driver...
waitForUserActivation is far more readable in the test - how many people know that test_driver.bless() means the test waits for user activation? I know I wasn't aware of that.
Right, but it's the same problem with .waitForUserActivation(): it could (was) be doing the unnecessary things. Using test_driver.bless() gives us single place (single thing to learn), and any updates to it will also benefit these tests. It reduces complexity and duplication.
I know I wasn't aware of that.
I understand. That should have been caught in review (and it's part of all of us learning what the test_driver API provides). This was caught because it then goes into WebKit's review.
See also saschanaz's comment, since keeping waitForUserActivation would make it easier to keep the 'load' listener, and also add workarounds if in the future we find a scenario where bless() doesn't quite do what we need.
Right, but we should only use something like waitForUserActivation() in cases where bless() doesn't do what we need.
The load listener might be a more general issue with the test design, which we hopefully shouldn't need at all. I'll take a look.
Ok, so, noting that bless() supports user activation within iframes. The load was using the wait for load on the iframes, but it's less racy to just set that explicitly. I've updated the tests to do that...
@saschanaz, @garykac, let me know what you think! Hopefully this captures the intent better.
Ok, closing this as I'm not getting time to go through them properly.