OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Tests default DOM layout structure for a VTTRegion.</title> | 2 <title>Tests default DOM layout structure for a VTTRegion.</title> |
3 <script src="../../media-controls.js"></script> | 3 <script src="../../media-controls.js"></script> |
4 <script src="../../media-file.js"></script> | 4 <script src="../../media-file.js"></script> |
5 <script src="../../../resources/testharness.js"></script> | 5 <script src="../../../resources/testharness.js"></script> |
6 <script src="../../../resources/testharnessreport.js"></script> | 6 <script src="../../../resources/testharnessreport.js"></script> |
7 <script> | 7 <script> |
8 async_test(function() { | 8 async_test(function() { |
9 var video = document.createElement('video'); | 9 var video = document.createElement('video'); |
10 video.src = findMediaFile('video', '../../content/test'); | 10 video.src = findMediaFile('video', '../../content/test'); |
11 var testTrack = document.createElement('track'); | 11 var testTrack = document.createElement('track'); |
12 testTrack.onload = this.step_func(function() { | 12 testTrack.onload = this.step_func(function() { |
13 video.oncanplaythrough = this.step_func_done(function() { | 13 video.oncanplaythrough = this.step_func_done(function() { |
14 assert_equals(testTrack.track.regions.length, 1); | 14 assert_equals(testTrack.track.regions.length, 1); |
15 | 15 |
16 var region = textTrackDisplayElement(video, 'region'); | 16 var region = textTrackRegionElement(video); |
17 var container = textTrackDisplayElement(video, 'region-container'); | 17 var container = textTrackRegionContainerElement(video); |
18 | 18 |
19 assert_equals(region.children.length, 1); | 19 assert_equals(region.children.length, 1); |
20 assert_equals(region.children[0], container); | 20 assert_equals(region.children[0], container); |
21 assert_equals(internals.shadowPseudoId(region), '-webkit-media-text-
track-region'); | 21 assert_equals(internals.shadowPseudoId(region), '-webkit-media-text-
track-region'); |
22 assert_equals(internals.shadowPseudoId(container), '-webkit-media-te
xt-track-region-container'); | 22 assert_equals(internals.shadowPseudoId(container), '-webkit-media-te
xt-track-region-container'); |
23 }); | 23 }); |
24 }); | 24 }); |
25 testTrack.src = '../captions-webvtt/captions-regions.vtt'; | 25 testTrack.src = '../captions-webvtt/captions-regions.vtt'; |
26 testTrack.kind = 'captions'; | 26 testTrack.kind = 'captions'; |
27 testTrack.default = true; | 27 testTrack.default = true; |
28 video.appendChild(testTrack); | 28 video.appendChild(testTrack); |
29 }); | 29 }); |
30 </script> | 30 </script> |
OLD | NEW |