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

Unified Diff: LayoutTests/media/track/opera/interfaces/VTTCue/position.html

Issue 851933003: WebVTT: Support 'auto' text position (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test nits. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/media/track/opera/track/webvtt/parsing/001.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50%
copy from LayoutTests/media/track/opera/interfaces/VTTCue/align.html
copy to LayoutTests/media/track/opera/interfaces/VTTCue/position.html
index 50649b428baaad18ffccaa65495b0955c2b177e8..f8faf99e89e79a071ae91f3e27d20947cb719fd9 100644
--- a/LayoutTests/media/track/opera/interfaces/VTTCue/align.html
+++ b/LayoutTests/media/track/opera/interfaces/VTTCue/position.html
@@ -1,50 +1,49 @@
<!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;
+ 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);
+ cue.position = 'auto';
+ assert_equals(cue.position, 'auto');
}, 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);
});
« no previous file with comments | « no previous file | LayoutTests/media/track/opera/track/webvtt/parsing/001.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698