[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-source-before-src.html
1 <html>
2 <head>
3 <script src=video-test.js></script>
4 <script>
5
6 if (window.testRunner) {
7     internals.settings.setVideoPlaybackRequiresUserGesture(true);
8     testRunner.waitUntilDone();
9     testRunner.dumpAsText();
10 }
11
12 var video
13
14 window.onload = () => {
15     video = document.getElementsByTagName("video")[0];
16     var source = document.createElement("source");
17     source.src = "source.mp4";
18     video.appendChild(source);
19     video.src = "src.mp4";
20
21     setTimeout(()=>{
22         testExpected("relativeURL(video.currentSrc)", "");
23         if (window.testRunner)
24             testRunner.notifyDone();
25     }, 1);
26 }
27
28 </script>
29 </head>
30 <body>
31 Append source element before setting src attribute.<br>
32 Platforms that support setVideoPlaybackRequiresUserGesture
33 will have the expected, empty, currentSrc. Platforms that don't should
34 have the unexpected "src.mp4".<br>
35 <video width=320 height=240></video>
36 </body>
37 </html>