[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / audio-playback-restriction-removed-muted.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>audio-playback-restriction</title>
5     <script src=media-file.js></script>
6     <script src=video-test.js></script>
7
8     <script>
9     function runTest()
10     {
11         video = document.getElementsByTagName('audio')[0];
12
13         if (window.internals)
14             run('internals.setMediaElementRestrictions(video, "RequireUserGestureForAudioRateChange")');
15
16         waitForEventAndFail('error');
17         waitForEvent('canplaythrough', canplaythrough);
18         run('video.src = findMediaFile("audio", "content/test")');
19     }    
20
21     function canplaythrough()
22     {
23         waitForEvent('playing', playing);
24         run('video.play()');
25     }
26
27     function playing()
28     {
29         waitForEventAndFail('pause');
30         runWithKeyDown('video.muted = false');
31         setTimeout(endTest, 250);
32     }
33     </script>
34 </head>
35
36 <body onload="runTest()">
37     <p>Test that when RequireUserGestureForAudioRateChange is set, setting muted with a user gesture clears the restriction.</p>
38     <audio muted controls></audio>
39 </body>
40 </html>
41