Skip to content
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

Media Session actions are untestable #18492

Open
foolip opened this issue Aug 16, 2019 · 2 comments
Open

Media Session actions are untestable #18492

foolip opened this issue Aug 16, 2019 · 2 comments

Comments

@foolip
Copy link
Member

foolip commented Aug 16, 2019

https://w3c.github.io/mediasession/#actions-model

The actions here, like play and pause, are user input similar to keyboard input, but might be triggered by other things like a button on a headphone cord or a lockscreen UI on phones. To test these actions isn't currently possible because there's no way to create synthetic user input of this type.

@LukeZielinski @beccahughes @mounirlamouri

@guest271314
Copy link
Contributor

Is the goal to test specific actions or to test the result of a user action?

@foolip
Copy link
Member Author

foolip commented Aug 27, 2019

It would be to test that the built-in behavior for these actions is correct. However, looks like no behavior is required by the spec, all I can find is this:

It is RECOMMENDED for user agents to implement a default handler for the play and pause media session actions if none was provided for the active media session.

If no action has any required side effect when action handlers aren't added, then the only thing that could be tested is that action handlers are invoked, and that would be very surface level and not really worth testing.

Compare to keyboard input, where testing the side effects of keyboard input on form elements is much more interesting than checking that the right keyboard events are fired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants