OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that directionality is set correctly on cues.</title> | 2 <title>Test that directionality is set correctly on cues.</title> |
3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
4 <script src="../media-file.js"></script> | 4 <script src="../media-file.js"></script> |
5 <script src="../media-controls.js"></script> | 5 <script src="../media-controls.js"></script> |
6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
8 <video> | 8 <video> |
9 <track src="captions-webvtt/captions-rtl.vtt" kind="captions" default> | 9 <track src="captions-webvtt/captions-rtl.vtt" kind="captions" default> |
10 </video> | 10 </video> |
(...skipping 10 matching lines...) Expand all Loading... |
21 "LTR cue تجربة", | 21 "LTR cue تجربة", |
22 ";1234تجربة", | 22 ";1234تجربة", |
23 "\t०१२३४५६७८९ \t", | 23 "\t०१२३४५६७८९ \t", |
24 "𐡘 (Imperial Aramaic number one, U+10858) strong RTL, non-BMP", | 24 "𐡘 (Imperial Aramaic number one, U+10858) strong RTL, non-BMP", |
25 "𝅘𝅥 (Musical symbol quarter note, U+1D15F) strong LTR, non-BMP", | 25 "𝅘𝅥 (Musical symbol quarter note, U+1D15F) strong LTR, non-BMP", |
26 "<ruby><rt>𝅘𝅥</rt>تجربة</ruby>", | 26 "<ruby><rt>𝅘𝅥</rt>تجربة</ruby>", |
27 "<ruby>1234<rt>تجربة</rt></ruby>"]; | 27 "<ruby>1234<rt>تجربة</rt></ruby>"]; |
28 | 28 |
29 // RTL cues alternate with LTR cues. | 29 // RTL cues alternate with LTR cues. |
30 video.onseeked = t.step_func(function() { | 30 video.onseeked = t.step_func(function() { |
31 var testCueDisplayBox = textTrackDisplayElement(video, "display"); | 31 var testCueDisplayBox = textTrackDisplayElement(video); |
32 | 32 |
33 // Jump to next cue. | 33 // Jump to next cue. |
34 assert_equals(video.currentTime, (seekedCount / 2) + 0.25); | 34 assert_equals(video.currentTime, (seekedCount / 2) + 0.25); |
35 assert_equals(testTrack.track.activeCues.length, 1); | 35 assert_equals(testTrack.track.activeCues.length, 1); |
36 assert_equals(testTrack.track.activeCues[0].text, info[seekedCount]); | 36 assert_equals(testTrack.track.activeCues[0].text, info[seekedCount]); |
37 assert_equals(testCueDisplayBox.innerText, info[seekedCount].replace(/<[
^>]+>/g, "")); | 37 assert_equals(testCueDisplayBox.innerText, info[seekedCount].replace(/<[
^>]+>/g, "")); |
38 | 38 |
39 var direction = seekedCount % 2 ? "ltr" : "rtl"; | 39 var direction = seekedCount % 2 ? "ltr" : "rtl"; |
40 | 40 |
41 assert_equals(2 * testCueDisplayBox.offsetLeft, video.videoWidth - testC
ueDisplayBox.offsetWidth); | 41 assert_equals(2 * testCueDisplayBox.offsetLeft, video.videoWidth - testC
ueDisplayBox.offsetWidth); |
42 | 42 |
43 assert_equals(getComputedStyle(testCueDisplayBox).direction, direction); | 43 assert_equals(getComputedStyle(testCueDisplayBox).direction, direction); |
44 | 44 |
45 if (++seekedCount == info.length) | 45 if (++seekedCount == info.length) |
46 t.done(); | 46 t.done(); |
47 else | 47 else |
48 video.currentTime += 0.5; | 48 video.currentTime += 0.5; |
49 }); | 49 }); |
50 | 50 |
51 video.currentTime = 0.25; | 51 video.currentTime = 0.25; |
52 }); | 52 }); |
53 </script> | 53 </script> |
OLD | NEW |