OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Test that setting MediaSession event handler should notify the service</t
itle> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 |
| 7 test(function(t) { |
| 8 window.navigator.mediaSession.setActionHandler("play", null); |
| 9 window.navigator.mediaSession.setActionHandler("pause", null); |
| 10 window.navigator.mediaSession.setActionHandler("previoustrack", null); |
| 11 window.navigator.mediaSession.setActionHandler("nexttrack", null); |
| 12 window.navigator.mediaSession.setActionHandler("seekbackward", null); |
| 13 window.navigator.mediaSession.setActionHandler("seekforward", null); |
| 14 }, "Test that setActionHandler() can be executed for supported actions"); |
| 15 |
| 16 test(function(t) { |
| 17 assert_throws( |
| 18 new TypeError("Failed to execute 'setActionHandler' on 'MediaSession':" + |
| 19 "The provided value 'invalid' is not a valid enum value" + |
| 20 "of type MediaSessionAction."), |
| 21 _ => { window.navigator.mediaSession.setActionHandler("invalid", null); })
; |
| 22 }, "Test that setActionHandler() throws exception for unsupported actions"); |
| 23 |
| 24 </script> |
OLD | NEW |