Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/regions-webvtt/vtt-region-display.html

Issue 2682333002: Implement VTTCue.region and sync the VTTRegion interface (Closed)
Patch Set: Add DCHECK Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Tests default rendering for TextTrackCues that belong to a VTTRegion.</ti tle> 2 <title>Tests default rendering for TextTrackCues that belong to a VTTRegion.</ti tle>
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 <video controls></video> 7 <video controls></video>
8 <script> 8 <script>
9 var region; 9 var region;
10 var seekTimes = [0.2, 0.5, 1.0, 2.3, 3.0]; 10 var seekTimes = [0.2, 0.5, 1.0, 2.3, 3.0];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 assert_equals(track.regions.length, 1); 42 assert_equals(track.regions.length, 1);
43 43
44 region = textTrackRegionElement(video); 44 region = textTrackRegionElement(video);
45 var container = textTrackRegionContainerElement(video); 45 var container = textTrackRegionContainerElement(video);
46 46
47 video.onseeked = this.step_func(function() { 47 video.onseeked = this.step_func(function() {
48 var totalVisibleLines = 0; 48 var totalVisibleLines = 0;
49 49
50 for (var i = 0; i < container.children.length; ++i) { 50 for (var i = 0; i < container.children.length; ++i) {
51 var cue = container.children[i]; 51 var cue = container.children[i];
52 totalVisibleLines += countVisibleLines(cue);; 52 totalVisibleLines += countVisibleLines(cue);
53 } 53 }
54 54
55 assert_less_than_equal(totalVisibleLines, track.regions[0].heigh t); 55 assert_less_than_equal(totalVisibleLines, track.regions[0].lines );
56 56
57 if (seekTimeIndex == seekTimes.length) 57 if (seekTimeIndex == seekTimes.length)
58 this.done(); 58 this.done();
59 else 59 else
60 video.currentTime = seekTimes[seekTimeIndex++]; 60 video.currentTime = seekTimes[seekTimeIndex++];
61 }); 61 });
62 video.currentTime = seekTimes[seekTimeIndex++]; 62 video.currentTime = seekTimes[seekTimeIndex++];
63 }); 63 });
64 }); 64 });
65 testTrack.src = '../captions-webvtt/captions-regions.vtt'; 65 testTrack.src = '../captions-webvtt/captions-regions.vtt';
66 testTrack.kind = 'captions'; 66 testTrack.kind = 'captions';
67 testTrack.default = true; 67 testTrack.default = true;
68 video.appendChild(testTrack); 68 video.appendChild(testTrack);
69 }); 69 });
70 </script> 70 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698