OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 |
| 6 <script src=../../media-controls.js></script> |
| 7 <script src=../../media-file.js></script> |
| 8 <script src=../../video-test.js></script> |
| 9 <script> |
| 10 var testTrack; |
| 11 var region; |
| 12 var container; |
| 13 |
| 14 function testRegionsDisplay() |
| 15 { |
| 16 testTrack = video.textTracks[0]; |
| 17 |
| 18 consoleWrite("** The text track has only one region **"); |
| 19 testExpected("testTrack.regions.length", 1); |
| 20 |
| 21 try { |
| 22 region = textTrackDisplayElement(video, 'region'); |
| 23 container = textTrackDisplayElement(video, 'region-container'); |
| 24 } catch(e) { |
| 25 consoleWrite(e); |
| 26 } |
| 27 |
| 28 consoleWrite("<br>** Inspecting the default DOM layout used for regi
ons display **"); |
| 29 |
| 30 consoleWrite("<br>** Only one region should be displayed **"); |
| 31 testExpected("region.children.length", 1); |
| 32 |
| 33 consoleWrite("<br>** The child of the region should be the container
**"); |
| 34 testExpected("region.children[0] == container", true); |
| 35 |
| 36 consoleWrite("<br>** Default pseudo IDs should be set properly"); |
| 37 testExpected("region.getAttribute('part')", "-webkit-media-text-trac
k-region"); |
| 38 testExpected("container.getAttribute('part')", "-webkit-media-text-t
rack-region-container"); |
| 39 |
| 40 endTest(); |
| 41 } |
| 42 |
| 43 function startTest() |
| 44 { |
| 45 if (!window.TextTrackRegion) { |
| 46 failTest(); |
| 47 return; |
| 48 } |
| 49 |
| 50 findMediaElement(); |
| 51 |
| 52 video.src = findMediaFile('video', '../../content/test'); |
| 53 waitForEvent('canplaythrough', testRegionsDisplay); |
| 54 } |
| 55 |
| 56 </script> |
| 57 </head> |
| 58 <body> |
| 59 <p>Tests default DOM layout structure for a TextTrackRegion.</p> |
| 60 <video controls> |
| 61 <track src="../captions-webvtt/captions-regions.vtt" kind="captions"
default onload="startTest()"> |
| 62 </video> |
| 63 </body> |
| 64 </html> |
OLD | NEW |