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

Side by Side Diff: third_party/WebKit/LayoutTests/media/mediasession/mojo/playback-state-propagated.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 Mojo Test</title>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../../../resources/mojo-helpers.js"></script>
6 <script src="resources/mediasessionservice-mock.js"></script>
7 <script src="resources/utils.js"></script>
8 <script>
9
10 var inputStates = ["none", "paused", "playing", "invalid", "none"];
11 var expectations;
12 var nextExpectation = 0;
13
14 // Delay the initialization since the initialization of MediaSessionPlaybackStat e is delayed.
15 function getExpectations() {
16 if (!expectations) {
17 expectations = [
18 MediaSessionPlaybackState.NONE,
19 MediaSessionPlaybackState.PAUSED,
20 MediaSessionPlaybackState.PLAYING,
21 MediaSessionPlaybackState.NONE,
22 ];
23 }
24 return expectations;
25 }
26
27 async_test(function(t) {
28 mediaSessionServiceMock.then(m => {
29 m.setPlaybackStateCallback(t.step_func(function(state) {
30 assert_equals(state, getExpectations()[nextExpectation++]);
31 if (nextExpectation == getExpectations().length)
32 t.done();
33 }));
34 for (let state of inputStates)
35 window.navigator.mediaSession.playbackState = state;
36 });
37 }, "test that MediaSession.playbackState is correctly propagated");
38
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698