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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/webvtt/webvtt-api-for-browsers/vttcue-interface/text.html

Issue 2711183003: Import wpt@a7e9c2abcf65b78fcf1c246fec6681c74e1bc352 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 9 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
(Empty)
1 <!doctype html>
2 <title>VTTCue.text</title>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <div id=log></div>
6 <script>
7 setup(function(){
8 window.video = document.createElement('video');
9 window.t1 = video.addTextTrack('subtitles');
10 document.body.appendChild(video);
11 });
12 test(function(){
13 var c1 = new VTTCue(0, 1, 'text1\r\n\n\u0000');
14 assert_equals(c1.text, 'text1\r\n\n\u0000');
15 c1.text = c1.text;
16 assert_equals(c1.text, 'text1\r\n\n\u0000');
17 c1.text = null;
18 assert_equals(c1.text, 'null');
19 }, document.title+', script-created cue');
20
21 var t_parsed = async_test(document.title+', parsed cue');
22 t_parsed.step(function(){
23 var t = document.createElement('track');
24 t.onload = this.step_func(function(){
25 var c = t.track.cues;
26 assert_equals(c[0].text, '');
27 assert_equals(c[1].text, 'test');
28 this.done();
29 });
30 t.onerror = this.step_func(function() {
31 assert_unreached('got error event');
32 });
33 t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:0 0:00.001\n'+
34 '\n\nfoobar\n00:00:00.000 --> 00:00:00.001\ntest');
35 t.track.mode = 'showing';
36 video.appendChild(t);
37 });
38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698