Skip to content

Picture-in-Picture test not waiting for event handler to run#58039

Open
theIDinside wants to merge 4 commits intoweb-platform-tests:masterfrom
theIDinside:fix-pip-tests
Open

Picture-in-Picture test not waiting for event handler to run#58039
theIDinside wants to merge 4 commits intoweb-platform-tests:masterfrom
theIDinside:fix-pip-tests

Conversation

@theIDinside
Copy link
Contributor

@theIDinside theIDinside commented Feb 25, 2026

See what the attribute says in the spec: https://w3c.github.io/picture-in-picture/#disable-pip:~:text=so%2E-,When,algorithm%2E and discussion w3c/picture-in-picture#184

This PR also addresses both the newly created one and the only one to actually wait for the event handler to execute so to not pass without running them as before.

This closes #58040

@theIDinside
Copy link
Contributor Author

See this documentation about promise_test using t.step functions

@beaufortfrancois
Copy link
Contributor

See this documentation about promise_test using t.step functions

Thanks!

It seems like some tests are not passing for Chrome anymore: https://wpt.fyi/results/picture-in-picture?diff&filter=ADC&run_id=5144633593298944&run_id=5171632596582400

Copy link
Contributor

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

Hopefully with the suggested change, tests should pass.

Copy link
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

Neat! Just a couple style nits to make the tests easier to reason about

@beaufortfrancois
Copy link
Contributor

I'm applying @marcoscaceres's feedback in https://chromium-review.googlesource.com/c/chromium/src/+/7664423 so that this PR remains only about splitting both tests.

@beaufortfrancois
Copy link
Contributor

@theIDinside My chromium WPT changes have been upstreamed: #58559 You can now rebase your changes on top of it

@beaufortfrancois
Copy link
Contributor

@theIDinside I think you still need to update picture-in-picture/leave-picture-in-picture.html

@theIDinside
Copy link
Contributor Author

picture-in-picture/leave-picture-in-picture.html

I'm sorry, I've lost the chain of thought on this one: what is it that I need to update here?

@theIDinside
Copy link
Contributor Author

Oh yeah, I think I see it. Re-remove the now re-added back in stuff due to rebase.

Fix the tests that passed on browsers without ever hitting the asserts because we did not wait for them to run.
assert_equals(document.pictureInPictureElement, null);
}, 'leavepictureinpicture event is fired if document.exitPictureInPicture');

promise_test(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test should be moved in the new file. That's all. No other changes should be needed. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's in the optional one.

Copy link
Contributor

Choose a reason for hiding this comment

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

The optional one doesn't have the same test as this one, which has been updated to address Marcos' feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, got it. I'll fix it. Too much page faulting going on in 🧠 over the past few days 😛

@web-platform-tests web-platform-tests deleted a comment from DextetP Mar 20, 2026
Make optional test pull in changes made by
beaufortfrancois in another review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Picture in Picture test not waiting for event handlers

4 participants