blob: 70375a76a6a87a57736140574d9fa2d82dbcf6cb [file] [log] [blame]
Tests modifying attributes of a TextTrackCue
** Test initial values.
RUN(textCue = cues.getCueById('1'))
EXPECTED (textCue.startTime == '0') OK
EXPECTED (textCue.endTime == '1') OK
EXPECTED (textCue.pauseOnExit == 'false') OK
EXPECTED (textCue.vertical == '') OK
EXPECTED (textCue.snapToLines == 'true') OK
EXPECTED (textCue.line == 'auto') OK
EXPECTED (textCue.position == 'auto') OK
EXPECTED (textCue.size == '100') OK
EXPECTED (textCue.align == 'center') OK
** Modify cue values.
RUN(textCue.startTime = 1.1)
EXPECTED (textCue.startTime == '1.1') OK
RUN(textCue.endTime = 3.9)
EXPECTED (textCue.endTime == '3.9') OK
RUN(textCue.pauseOnExit = true)
EXPECTED (textCue.pauseOnExit == 'true') OK
EXPECTED (textCue.vertical == '') OK
RUN(textCue.vertical = 'rl')
EXPECTED (textCue.vertical == 'rl') OK
RUN(textCue.snapToLines = false)
EXPECTED (textCue.snapToLines == 'false') OK
RUN(textCue.line = 42)
EXPECTED (textCue.line == '42') OK
RUN(textCue.snapToLines = true)
RUN(textCue.line = -2)
EXPECTED (textCue.line == '-2') OK
RUN(textCue.line = 102)
EXPECTED (textCue.line == '102') OK
On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue text position to the new value.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line
TEST(textCue.position = -200) THROWS(DOMException.INDEX_SIZE_ERR) OK
TEST(textCue.position = 110) THROWS(DOMException.INDEX_SIZE_ERR) OK
RUN(textCue.position = 11)
EXPECTED (textCue.position == '11') OK
On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue size to the new value.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
TEST(textCue.size = -200) THROWS(DOMException.INDEX_SIZE_ERR) OK
TEST(textCue.size = 110) THROWS(DOMException.INDEX_SIZE_ERR) OK
RUN(textCue.size = 57)
EXPECTED (textCue.size == '57') OK
RUN(textCue.align = 'End')
EXPECTED (textCue.align == 'center') OK
RUN(textCue.align = 'end')
EXPECTED (textCue.align == 'end') OK
END OF TEST