Chromium Code Reviews| Index: LayoutTests/media/track/opera/interfaces/VTTCue/position.html |
| diff --git a/LayoutTests/media/track/opera/interfaces/VTTCue/align.html b/LayoutTests/media/track/opera/interfaces/VTTCue/position.html |
| similarity index 51% |
| copy from LayoutTests/media/track/opera/interfaces/VTTCue/align.html |
| copy to LayoutTests/media/track/opera/interfaces/VTTCue/position.html |
| index 50649b428baaad18ffccaa65495b0955c2b177e8..2d7bc110e3965a01271475fd6ee4dc521e5e6bca 100644 |
| --- a/LayoutTests/media/track/opera/interfaces/VTTCue/align.html |
| +++ b/LayoutTests/media/track/opera/interfaces/VTTCue/position.html |
| @@ -1,50 +1,47 @@ |
| <!doctype html> |
| -<title>VTTCue.align</title> |
| +<title>VTTCue.position</title> |
| <script src=../../../../../resources/testharness.js></script> |
| <script src=../../../../../resources/testharnessreport.js></script> |
| <div id=log></div> |
| <script> |
| -test(function(){ |
| +test(function() { |
| var video = document.createElement('video'); |
| document.body.appendChild(video); |
| - var c1 = new VTTCue(0, 1, 'text1'); |
| - assert_equals(c1.align, 'middle'); |
| + var cue = new VTTCue(0, 1, 'text1'); |
| + assert_equals(cue.position, 'auto'); |
| var track = document.createElement('track'); |
| var t = track.track; |
| - t.addCue(c1); |
| - assert_equals(c1.align, 'middle'); |
| + t.addCue(cue); |
| + assert_equals(cue.position, 'auto'); |
| video.appendChild(track); |
| - assert_equals(c1.align, 'middle'); |
| + assert_equals(cue.position, 'auto'); |
| t.mode = 'showing'; |
| - assert_equals(c1.align, 'middle'); |
| - c1.align = 'start'; |
| - assert_equals(c1.align, 'start'); |
| - c1.align = 'end'; |
| - assert_equals(c1.align, 'end'); |
| - c1.align = 'start\u0000'; |
| - assert_equals(c1.align, 'end'); |
| + assert_equals(cue.position, 'auto'); |
| + cue.position = 50; |
|
philipj_slow
2015/01/21 15:02:14
Also try setting to 'auto'.
fs
2015/01/21 15:28:24
Done.
|
| + assert_equals(cue.position, 50); |
| + assert_throws(new TypeError, function() { cue.position = 'auto\u0000'; }); |
| + assert_throws(new TypeError, function() { cue.position = NaN; }); |
| + assert_throws(new TypeError, function() { cue.position = Infinity; }); |
| + assert_equals(cue.position, 50); |
| }, document.title+', script-created cue'); |
| var t_parsed = async_test(document.title+', parsed cue'); |
| -t_parsed.step(function(){ |
| +t_parsed.step(function() { |
| var video = document.createElement('video'); |
| document.body.appendChild(video); |
| var t = document.createElement('track'); |
| - t.onload = this.step_func(function(){ |
| - var c1 = t.track.cues[0]; |
| - var c2 = t.track.cues[1]; |
| - var c3 = t.track.cues[2]; |
| - var c4 = t.track.cues[3]; |
| - assert_equals(c1.align, 'middle'); |
| - assert_equals(c2.align, 'start'); |
| - assert_equals(c3.align, 'middle'); |
| - assert_equals(c4.align, 'end'); |
| + t.onload = this.step_func(function() { |
| + var cues = t.track.cues; |
| + assert_equals(cues[0].position, 'auto'); |
| + assert_equals(cues[1].position, 'auto'); |
| + assert_equals(cues[2].position, 25); |
| + assert_equals(cues[3].position, 75); |
| this.done(); |
| }); |
| t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest\n\n'+ |
| '00:00:00.000 --> 00:00:00.001 align:start\ntest\n\n'+ |
| - '00:00:00.000 --> 00:00:00.001 align:middle\ntest\n\n'+ |
| - '00:00:00.000 --> 00:00:00.001 align:end\ntest'); |
| + '00:00:00.000 --> 00:00:00.001 position:25%\ntest\n\n'+ |
| + '00:00:00.000 --> 00:00:00.001 align:start position:75%\ntest\n\n'); |
| t.track.mode = 'showing'; |
| video.appendChild(t); |
| }); |