Multiplex the HID and GameController gamepad providers on Mac.
[WebKit-https.git] / LayoutTests / media / video-src-remove.html
1 <html>
2 <body>
3     <script src=media-file.js></script>
4     <script src=video-test.js></script>
5     <div id=panel></div>
6
7     <p>Test that removing valid 'src' attribute DOES NOT trigger load of &lt;source&gt; elements</p>
8
9     <script>
10
11         var loadCount = 0;
12         
13         function testSrc()
14         {
15             testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
16             testExpected("isNaN(video.duration)", false);
17             consoleWrite("");
18         }
19
20         function loadedmetadata()
21         {
22             consoleWrite("EVENT(loadedmetadata)");
23
24             ++loadCount;
25             if (loadCount == 1)
26             {
27                 testSrc();
28                 run("video.removeAttribute('src')");
29             }
30             else
31             {
32                 consoleWrite("<span style='color:red'>FAIL</span> : 'loadCount' fired " + loadCount + "times" );
33                 endTest();
34             }
35             consoleWrite("");
36             setTimeout(someTimeLater, 100) ;
37         }
38         
39         function someTimeLater()
40         {
41             testSrc();
42             endTest();
43             consoleWrite("");
44         }
45
46         var panel = document.getElementById("panel");
47         var mediaFile = findMediaFile("video", "content/test");
48         panel.innerHTML = "<video src=" + mediaFile + " controls onloadedmetadata='loadedmetadata()'><source src=content/counting.mp4></video>";
49         findMediaElement();
50
51         consoleWrite("");
52     </script>
53
54 </body>
55 </html>