w3c / screen-wake-lock

Screen Wake Lock API
https://www.w3.org/TR/screen-wake-lock/
Other
85 stars 35 forks source link

Add more visibility tests #373

Open marcoscaceres opened 5 months ago

marcoscaceres commented 5 months ago

elsewhere @rakuco suggested adding a test:

using window_state_context() to change the page visibility after calling request() and verifying the latter fails

As a reminder to myself (or whomever creates that), we should do that in separate file....

rakuco commented 5 months ago

For future reference: we already have screen-wake-lock/wakelock-document-hidden.https.html that tests that calling request() after setting the page visibility state to "hidden" throws NotAllowedError. What I was wondering is whether we could test the specific case being added in #367 (i.e. the page is visible when request() is called, so the visibility check passes, but the visibility changes to "hidden" before the "fully active" check in the parallel steps happens).