| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>MediaSession.playbackState attribute</title> | 2 <title>MediaSession.playbackState attribute</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src=/resources/testharness.js></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 test(function() { | 7 test(function() { |
| 8 assert_equals(window.navigator.mediaSession.playbackState, "none"); | 8 assert_equals(window.navigator.mediaSession.playbackState, "none"); |
| 9 }, 'Test that playbackState is initialized as "none"'); | 9 }, 'Test that playbackState is initialized as "none"'); |
| 10 | 10 |
| 11 test(function() { | 11 test(function() { |
| 12 var states = [ "paused", "playing", "none" ]; | 12 var states = [ "paused", "playing", "none" ]; |
| 13 for (let state of states) { | 13 for (let state of states) { |
| 14 window.navigator.mediaSession.playbackState = state; | 14 window.navigator.mediaSession.playbackState = state; |
| 15 assert_equals(window.navigator.mediaSession.playbackState, state); | 15 assert_equals(window.navigator.mediaSession.playbackState, state); |
| 16 } | 16 } |
| 17 }, 'Test that playbackState is read/write'); | 17 }, 'Test that playbackState is read/write'); |
| 18 | 18 |
| 19 test(function() { | 19 test(function() { |
| 20 var invalidStates = [ "invalid", "" ]; | 20 var invalidStates = [ "invalid", "" ]; |
| 21 for (let state of invalidStates) { | 21 for (let state of invalidStates) { |
| 22 window.navigator.mediaSession.playbackState = state; | 22 window.navigator.mediaSession.playbackState = state; |
| 23 assert_equals(window.navigator.mediaSession.playbackState, "none"); | 23 assert_equals(window.navigator.mediaSession.playbackState, "none"); |
| 24 } | 24 } |
| 25 }, 'Test that warning is thrown when setting invalid playbackState'); | 25 }, 'Test that warning is thrown when setting invalid playbackState'); |
| 26 | 26 |
| 27 </script> | 27 </script> |
| OLD | NEW |