https://github.com/web-platform-tests/wpt
Raw File
Tip revision: d687e029cdd49250b4446518d1d4ad11d5354e0a authored by Philip Jägenstedt on 03 December 2018, 14:22:18 UTC
Rename audio-output idlharness test for secure context change
Tip revision: d687e02
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,
      _ => { window.navigator.mediaSession.setActionHandler("invalid", null); });
}, "Test that setActionHandler() throws exception for unsupported actions");

</script>
back to top