https://github.com/web-platform-tests/wpt
Raw File
Tip revision: f2aec0f81748fe3550e283d4787bb703dc37626c authored by moz-wptsync-bot on 13 March 2018, 19:13:05 UTC
part 3. Move the .links getter from HTMLDocument to Document.
Tip revision: f2aec0f
setactionhandler.html
<!DOCTYPE html>
<title>Test that setting MediaSession event handler should notify the service</title>
<script src=/resources/testharness.js></script>
<script src="/resources/testharnessreport.js"></script>
<script>

test(function(t) {
  window.navigator.mediaSession.setActionHandler("play", null);
  window.navigator.mediaSession.setActionHandler("pause", null);
  window.navigator.mediaSession.setActionHandler("previoustrack", null);
  window.navigator.mediaSession.setActionHandler("nexttrack", null);
  window.navigator.mediaSession.setActionHandler("seekbackward", null);
  window.navigator.mediaSession.setActionHandler("seekforward", null);
}, "Test that setActionHandler() can be executed for supported actions");

test(function(t) {
  assert_throws(
      new TypeError("Failed to execute 'setActionHandler' on 'MediaSession':" +
                    "The provided value 'invalid' is not a valid enum value" +
                    "of type MediaSessionAction."),
      _ => { window.navigator.mediaSession.setActionHandler("invalid", null); });
}, "Test that setActionHandler() throws exception for unsupported actions");

</script>
back to top