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"); | |
mlamouri (slow - plz ping)
2016/12/23 12:13:58
nit: s/test/Test/
Zhiqiang Zhang (Slow)
2017/01/05 09:29:15
Done.
| |
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"); | |
mlamouri (slow - plz ping)
2016/12/23 12:13:58
ditto
Zhiqiang Zhang (Slow)
2017/01/05 09:29:15
Done.
| |
23 | |
24 </script> | |
OLD | NEW |