[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / media-fullscreen-return-to-inline.html
1 <!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3 <head>
4     <title>media-fullscreen-return-to-inline</title>
5
6     <script src="video-test.js"></script>
7     <script src="media-file.js"></script>
8
9     <script>
10     function go()
11     {
12         findMediaElement();
13         run('internals.settings.setAllowsInlineMediaPlayback(false)');
14         run('internals.settings.setAllowsInlineMediaPlaybackAfterFullscreen(false)');
15         run('video.src = findMediaFile("video", "content/test")');
16         waitForEventOnce('canplaythrough', canplaythrough);
17     }
18
19     function canplaythrough()
20     {
21         runWithKeyDown('video.play()');
22         waitForEventOnce('webkitfullscreenchange', beginfullscreen1);
23     }
24
25     function beginfullscreen1()
26     {
27         run('video.webkitExitFullscreen()');
28         waitForEventOnce('pause', pause);
29     }
30
31     function pause()
32     {
33         run('internals.settings.setAllowsInlineMediaPlaybackAfterFullscreen(true)');
34         runWithKeyDown('video.play()');
35         waitForEventOnce('webkitfullscreenchange', beginfullscreen2);
36     }
37
38     function beginfullscreen2()
39     {
40         run('video.webkitExitFullscreen()');
41         waitForEventOnce('webkitfullscreenchange', endfullscreen);
42     }
43
44     function endfullscreen()
45     {
46         testExpected('video.paused', false);
47         endTest();
48     }
49     </script>
50
51 </head>
52
53 <body onload="go()">
54     <video controls></video>
55 </body>
56 </html>