| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 | 5 |
| 6 <script src=media-file.js></script> | 6 <script src=media-file.js></script> |
| 7 <script src=video-test.js></script> | 7 <script src=video-test.js></script> |
| 8 <script src=media-controls.js></script> | 8 <script src=media-controls.js></script> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| 11 function canplaythrough() | 11 function canplaythrough() |
| 12 { | 12 { |
| 13 consoleWrite("<br>** Initial state: no text tracks, controls sho
uld not be visible **"); | 13 consoleWrite("<br>** Initial state: no text tracks, controls sho
uld not be visible **"); |
| 14 testExpected("video.textTracks.length", 0); | 14 testExpected("video.textTracks.length", 0); |
| 15 testExpected("video.controls", false, '=='); | 15 testExpected("video.controls", false, '=='); |
| 16 testExpected("internals.shadowRoot(video).firstChild", null); | |
| 17 | 16 |
| 18 consoleWrite("<br>** Add a text track, controls should not becom
e visible **"); | 17 consoleWrite("<br>** Add a text track, controls should not becom
e visible **"); |
| 19 run("video.addTextTrack('captions')"); | 18 run("video.addTextTrack('captions')"); |
| 20 testExpected("video.textTracks.length", 1); | 19 testExpected("video.textTracks.length", 1); |
| 21 testExpected("video.controls", false); | 20 testExpected("video.controls", false); |
| 22 testExpected("internals.shadowRoot(video).firstChild", null); | |
| 23 | 21 |
| 24 consoleWrite("<br>** Enable controls **"); | 22 consoleWrite("<br>** Enable controls **"); |
| 25 run("video.setAttribute('controls','controls')"); | 23 run("video.setAttribute('controls','controls')"); |
| 26 testExpected("video.textTracks.length", 1); | 24 testExpected("video.textTracks.length", 1); |
| 27 testExpected("video.controls", true); | 25 testExpected("video.controls", true); |
| 28 panel = mediaControlsButton(video, "panel"); | 26 panel = mediaControlsButton(video, "panel"); |
| 29 testExpected("internals.shadowRoot(video).firstChild", null, "!=
"); | 27 testExpected("internals.shadowRoot(video).firstChild", null, "!=
"); |
| 30 testExpected("panel.style['display']", 'none', "!="); | 28 testExpected("panel.style['display']", 'none', "!="); |
| 31 | 29 |
| 32 consoleWrite(""); | 30 consoleWrite(""); |
| 33 endTest(); | 31 endTest(); |
| 34 } | 32 } |
| 35 | 33 |
| 36 function start() | 34 function start() |
| 37 { | 35 { |
| 38 findMediaElement(); | 36 findMediaElement(); |
| 39 | 37 |
| 40 waitForEvent('canplaythrough', canplaythrough); | 38 waitForEvent('canplaythrough', canplaythrough); |
| 41 video.src = findMediaFile("video", "content/test"); | 39 video.src = findMediaFile("video", "content/test"); |
| 42 } | 40 } |
| 43 | 41 |
| 44 </script> | 42 </script> |
| 45 </head> | 43 </head> |
| 46 <body onload="start()"> | 44 <body onload="start()"> |
| 47 <video> | 45 <video> |
| 48 </video> | 46 </video> |
| 49 <p>Tests that adding a text track does not make controls visible.</p> | 47 <p>Tests that adding a text track does not make controls visible.</p> |
| 50 </body> | 48 </body> |
| 51 </html> | 49 </html> |
| OLD | NEW |