Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: third_party/WebKit/LayoutTests/media/mediasession/mediasession-playbackstate.html

Issue 2583463002: [MediaSession] Add playbackState attribute to Blink MediaSession and use it to determine playback s… (Closed)
Patch Set: rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>MediaSession.playbackState attribute</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 test(function() {
8 assert_equals(window.navigator.mediaSession.playbackState, "none");
9 }, 'Test that playbackState is initialized as "none"');
10
11 test(function() {
12 var states = [ "paused", "playing", "none" ];
13 for (let state of states) {
14 window.navigator.mediaSession.playbackState = state;
15 assert_equals(window.navigator.mediaSession.playbackState, state);
16 }
17 }, 'Test that playbackState is read/write');
18
19 test(function() {
20 var invalidStates = [ "invalid", "" ];
21 for (let state of invalidStates) {
22 window.navigator.mediaSession.playbackState = state;
23 assert_equals(window.navigator.mediaSession.playbackState, "none");
24 }
25 }, 'Test that warning is thrown when setting invalid playbackState');
26
27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698