Revision ecc1a8f2d2e7c43cc50feacadc012c491abbb736 authored by Anne van Kesteren on 17 February 2017, 10:44:29 UTC, committed by Anne van Kesteren on 07 June 2018, 14:19:25 UTC
1 parent dd8e0ac
playbackstate.html
<!DOCTYPE html>
<title>MediaSession.playbackState attribute</title>
<script src=/resources/testharness.js></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_equals(window.navigator.mediaSession.playbackState, "none");
}, 'Test that playbackState is initialized as "none"');
test(function() {
var states = [ "paused", "playing", "none" ];
for (let state of states) {
window.navigator.mediaSession.playbackState = state;
assert_equals(window.navigator.mediaSession.playbackState, state);
}
}, 'Test that playbackState is read/write');
test(function() {
var invalidStates = [ "invalid", "" ];
for (let state of invalidStates) {
window.navigator.mediaSession.playbackState = state;
assert_equals(window.navigator.mediaSession.playbackState, "none");
}
}, 'Test that warning is thrown when setting invalid playbackState');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...