Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Media Session actions are untestable #18492
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.
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:
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.