OLD | NEW |
1 Tests modifying attributes of a VTTCue | 1 Tests modifying attributes of a VTTCue |
2 | 2 |
3 ** Test initial values. | 3 ** Test initial values. |
4 RUN(textCue = cues.getCueById('1')) | 4 RUN(textCue = cues.getCueById('1')) |
5 EXPECTED (textCue.startTime == '0') OK | 5 EXPECTED (textCue.startTime == '0') OK |
6 EXPECTED (textCue.endTime == '1') OK | 6 EXPECTED (textCue.endTime == '1') OK |
7 EXPECTED (textCue.pauseOnExit == 'false') OK | 7 EXPECTED (textCue.pauseOnExit == 'false') OK |
8 EXPECTED (textCue.vertical == '') OK | 8 EXPECTED (textCue.vertical == '') OK |
9 EXPECTED (textCue.snapToLines == 'true') OK | 9 EXPECTED (textCue.snapToLines == 'true') OK |
10 EXPECTED (textCue.line == '-1') OK | 10 EXPECTED (textCue.line == 'auto') OK |
11 EXPECTED (textCue.position == '50') OK | 11 EXPECTED (textCue.position == '50') OK |
12 EXPECTED (textCue.size == '100') OK | 12 EXPECTED (textCue.size == '100') OK |
13 EXPECTED (textCue.align == 'middle') OK | 13 EXPECTED (textCue.align == 'middle') OK |
14 | 14 |
15 ** Modify cue values. | 15 ** Modify cue values. |
16 RUN(textCue.startTime = 1.1) | 16 RUN(textCue.startTime = 1.1) |
17 EXPECTED (textCue.startTime == '1.1') OK | 17 EXPECTED (textCue.startTime == '1.1') OK |
18 | 18 |
19 RUN(textCue.endTime = 3.9) | 19 RUN(textCue.endTime = 3.9) |
20 EXPECTED (textCue.endTime == '3.9') OK | 20 EXPECTED (textCue.endTime == '3.9') OK |
21 | 21 |
22 RUN(textCue.pauseOnExit = true) | 22 RUN(textCue.pauseOnExit = true) |
23 EXPECTED (textCue.pauseOnExit == 'true') OK | 23 EXPECTED (textCue.pauseOnExit == 'true') OK |
24 | 24 |
25 On setting, the text track cue writing direction must be set to the value given
in the first cell of the row in the table above whose second cell is a case-sens
itive match for the new value. | 25 On setting, the text track cue writing direction must be set to the value given
in the first cell of the row in the table above whose second cell is a case-sens
itive match for the new value. |
26 http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical | 26 http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical |
27 RUN(textCue.vertical = 'RL') | 27 RUN(textCue.vertical = 'RL') |
28 EXPECTED (textCue.vertical == '') OK | 28 EXPECTED (textCue.vertical == '') OK |
29 RUN(textCue.vertical = 'rl') | 29 RUN(textCue.vertical = 'rl') |
30 EXPECTED (textCue.vertical == 'rl') OK | 30 EXPECTED (textCue.vertical == 'rl') OK |
31 | 31 |
32 RUN(textCue.snapToLines = false) | 32 RUN(textCue.snapToLines = false) |
33 EXPECTED (textCue.snapToLines == 'false') OK | 33 EXPECTED (textCue.snapToLines == 'false') OK |
34 | 34 |
35 On setting, if the text track cue snap-to-lines flag is not set, and the new val
ue is negative or greater than 100, then throw an IndexSizeError exception. | 35 On setting, the text track cue line position must be set to the new value; if th
e new value is the string 'auto', then it must be interpreted as the special val
ue auto. |
36 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.ht
ml#dom-texttrackcue-line | 36 http://dev.w3.org/html5/webvtt/#dfn-vttcue-line |
37 TEST(textCue.line = -2) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the 'l
ine' property on 'VTTCue': The snap-to-lines flag is not set, and the value prov
ided (-2) is not between 0 and 100.) OK | 37 EXPECTED (textCue.line == 'auto') OK |
38 TEST(textCue.line = 102) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the '
line' property on 'VTTCue': The snap-to-lines flag is not set, and the value pro
vided (102) is not between 0 and 100.) OK | 38 TEST(textCue.line = 'gazonk') THROWS("TypeError: Failed to set the 'line' proper
ty on 'VTTCue': 'gazonk' is not a valid enum value.") OK |
39 EXPECTED (textCue.line == '-1') OK | 39 EXPECTED (textCue.line == 'auto') OK |
40 RUN(textCue.line = 42) | 40 RUN(textCue.line = 42) |
41 EXPECTED (textCue.line == '42') OK | 41 EXPECTED (textCue.line == '42') OK |
| 42 RUN(textCue.line = -2) |
| 43 EXPECTED (textCue.line == '-2') OK |
| 44 RUN(textCue.line = 102) |
| 45 EXPECTED (textCue.line == '102') OK |
42 RUN(textCue.snapToLines = true) | 46 RUN(textCue.snapToLines = true) |
43 RUN(textCue.line = -2) | 47 RUN(textCue.line = -2) |
44 EXPECTED (textCue.line == '-2') OK | 48 EXPECTED (textCue.line == '-2') OK |
45 RUN(textCue.line = 102) | 49 RUN(textCue.line = 102) |
46 EXPECTED (textCue.line == '102') OK | 50 EXPECTED (textCue.line == '102') OK |
47 | 51 |
48 On setting, if the new value is negative or greater than 100, then throw an Inde
xSizeError exception. Otherwise, set the text track cue text position to the new
value. | 52 On setting, if the new value is negative or greater than 100, then throw an Inde
xSizeError exception. Otherwise, set the text track cue text position to the new
value. |
49 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.ht
ml#dom-texttrackcue-line | 53 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.ht
ml#dom-texttrackcue-line |
50 TEST(textCue.position = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set
the 'position' property on 'VTTCue': The value provided (-200) is outside the ra
nge [0, 100].) OK | 54 TEST(textCue.position = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set
the 'position' property on 'VTTCue': The value provided (-200) is outside the ra
nge [0, 100].) OK |
51 TEST(textCue.position = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set t
he 'position' property on 'VTTCue': The value provided (110) is outside the rang
e [0, 100].) OK | 55 TEST(textCue.position = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set t
he 'position' property on 'VTTCue': The value provided (110) is outside the rang
e [0, 100].) OK |
52 RUN(textCue.position = 11) | 56 RUN(textCue.position = 11) |
53 EXPECTED (textCue.position == '11') OK | 57 EXPECTED (textCue.position == '11') OK |
54 | 58 |
55 On setting, if the new value is negative or greater than 100, then throw an Inde
xSizeError exception. Otherwise, set the text track cue size to the new value. | 59 On setting, if the new value is negative or greater than 100, then throw an Inde
xSizeError exception. Otherwise, set the text track cue size to the new value. |
56 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.ht
ml#dom-texttrackcue-size | 60 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.ht
ml#dom-texttrackcue-size |
57 TEST(textCue.size = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the
'size' property on 'VTTCue': The value provided (-200) is outside the range [0,
100].) OK | 61 TEST(textCue.size = -200) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the
'size' property on 'VTTCue': The value provided (-200) is outside the range [0,
100].) OK |
58 TEST(textCue.size = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the '
size' property on 'VTTCue': The value provided (110) is outside the range [0, 10
0].) OK | 62 TEST(textCue.size = 110) THROWS(DOMException.INDEX_SIZE_ERR: Failed to set the '
size' property on 'VTTCue': The value provided (110) is outside the range [0, 10
0].) OK |
59 RUN(textCue.size = 57) | 63 RUN(textCue.size = 57) |
60 EXPECTED (textCue.size == '57') OK | 64 EXPECTED (textCue.size == '57') OK |
61 | 65 |
62 On setting, the text track cue text alignment must be set to the value given in
the first cell of the row in the table above whose second cell is a case-sensiti
ve match for the new value. | 66 On setting, the text track cue text alignment must be set to the value given in
the first cell of the row in the table above whose second cell is a case-sensiti
ve match for the new value. |
63 http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align | 67 http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align |
64 RUN(textCue.align = 'End') | 68 RUN(textCue.align = 'End') |
65 EXPECTED (textCue.align == 'middle') OK | 69 EXPECTED (textCue.align == 'middle') OK |
66 RUN(textCue.align = 'end') | 70 RUN(textCue.align = 'end') |
67 EXPECTED (textCue.align == 'end') OK | 71 EXPECTED (textCue.align == 'end') OK |
68 | 72 |
69 END OF TEST | 73 END OF TEST |
70 | 74 |
OLD | NEW |