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

Side by Side Diff: LayoutTests/media/track/opera/interfaces/VTTCue/line.html

Issue 72543003: Update TextTrackCue tests to use VTTCue where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <title>TextTrackCue.line</title> 2 <title>VTTCue.line</title>
3 <script src=../../../../../resources/testharness.js></script> 3 <script src=../../../../../resources/testharness.js></script>
4 <script src=../../../../../resources/testharnessreport.js></script> 4 <script src=../../../../../resources/testharnessreport.js></script>
5 <div id=log></div> 5 <div id=log></div>
6 <script> 6 <script>
7 test(function(){ 7 test(function(){
8 var video = document.createElement('video'); 8 var video = document.createElement('video');
9 document.body.appendChild(video); 9 document.body.appendChild(video);
10 var c1 = new TextTrackCue(0, 1, 'text1'); 10 var c1 = new VTTCue(0, 1, 'text1');
11 assert_equals(c1.line, -1); 11 assert_equals(c1.line, -1);
12 var track = document.createElement('track'); 12 var track = document.createElement('track');
13 var t = track.track; 13 var t = track.track;
14 t.addCue(c1); 14 t.addCue(c1);
15 assert_equals(c1.line, -1); 15 assert_equals(c1.line, -1);
16 video.appendChild(track); 16 video.appendChild(track);
17 assert_equals(c1.line, -1); 17 assert_equals(c1.line, -1);
18 t.mode = 'showing'; 18 t.mode = 'showing';
19 assert_equals(c1.line, -1); 19 assert_equals(c1.line, -1);
20 var c2 = new TextTrackCue(0, 1, 'text2'); 20 var c2 = new VTTCue(0, 1, 'text2');
21 var track2 = document.createElement('track'); 21 var track2 = document.createElement('track');
22 var t2 = track2.track; 22 var t2 = track2.track;
23 t2.addCue(c2); 23 t2.addCue(c2);
24 assert_equals(c2.line, -1); 24 assert_equals(c2.line, -1);
25 video.appendChild(track2); 25 video.appendChild(track2);
26 t2.mode = 'showing'; 26 t2.mode = 'showing';
27 assert_equals(c2.line, -2); 27 assert_equals(c2.line, -2);
28 assert_equals(c1.line, -1); 28 assert_equals(c1.line, -1);
29 c1.line = -5; 29 c1.line = -5;
30 assert_equals(c1.line, -5); 30 assert_equals(c1.line, -5);
(...skipping 19 matching lines...) Expand all
50 50
51 this.done(); 51 this.done();
52 }); 52 });
53 t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:0 0:00.001\ntest\n\n'+ 53 t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:0 0:00.001\ntest\n\n'+
54 '00:00:00.000 --> 00:00:00.001 l ine:0\ntest\n\n'+ 54 '00:00:00.000 --> 00:00:00.001 l ine:0\ntest\n\n'+
55 '00:00:00.000 --> 00:00:00.001 l ine:0%\ntest'); 55 '00:00:00.000 --> 00:00:00.001 l ine:0%\ntest');
56 t.track.mode = 'showing'; 56 t.track.mode = 'showing';
57 video.appendChild(t); 57 video.appendChild(t);
58 }); 58 });
59 </script> 59 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698