| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 5 | 5 |
| 6 <script src=../media-file.js></script> | 6 <script src=../media-file.js></script> |
| 7 <script src=../video-test.js></script> | 7 <script src=../video-test.js></script> |
| 8 <script> | 8 <script> |
| 9 | 9 |
| 10 var cues; | 10 var cues; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 cues = track.track.cues; | 21 cues = track.track.cues; |
| 22 | 22 |
| 23 consoleWrite("** Test initial values."); | 23 consoleWrite("** Test initial values."); |
| 24 run("textCue = cues.getCueById('1')"); | 24 run("textCue = cues.getCueById('1')"); |
| 25 | 25 |
| 26 testExpected("textCue.startTime", 0); | 26 testExpected("textCue.startTime", 0); |
| 27 testExpected("textCue.endTime", 1.0); | 27 testExpected("textCue.endTime", 1.0); |
| 28 testExpected("textCue.pauseOnExit", false); | 28 testExpected("textCue.pauseOnExit", false); |
| 29 testExpected("textCue.vertical", ""); | 29 testExpected("textCue.vertical", ""); |
| 30 testExpected("textCue.snapToLines", true); | 30 testExpected("textCue.snapToLines", true); |
| 31 testExpected("textCue.line", -1); | 31 testExpected("textCue.line", "auto"); |
| 32 testExpected("textCue.position", 50); | 32 testExpected("textCue.position", 50); |
| 33 testExpected("textCue.size", 100); | 33 testExpected("textCue.size", 100); |
| 34 testExpected("textCue.align", "middle"); | 34 testExpected("textCue.align", "middle"); |
| 35 | 35 |
| 36 consoleWrite("<br>** Modify cue values."); | 36 consoleWrite("<br>** Modify cue values."); |
| 37 | 37 |
| 38 run("textCue.startTime = 1.1"); | 38 run("textCue.startTime = 1.1"); |
| 39 testExpected("textCue.startTime", 1.1); | 39 testExpected("textCue.startTime", 1.1); |
| 40 | 40 |
| 41 consoleWrite(""); | 41 consoleWrite(""); |
| 42 run("textCue.endTime = 3.9"); | 42 run("textCue.endTime = 3.9"); |
| 43 testExpected("textCue.endTime", 3.9); | 43 testExpected("textCue.endTime", 3.9); |
| 44 | 44 |
| 45 consoleWrite(""); | 45 consoleWrite(""); |
| 46 run("textCue.pauseOnExit = true"); | 46 run("textCue.pauseOnExit = true"); |
| 47 testExpected("textCue.pauseOnExit", true); | 47 testExpected("textCue.pauseOnExit", true); |
| 48 | 48 |
| 49 logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-verti
cal", | 49 logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-verti
cal", |
| 50 "On setting, the text track cue writing direction mus
t be set to the value given in the first cell of the row in the table above whos
e second cell is a case-sensitive match for the new value."); | 50 "On setting, the text track cue writing direction mus
t be set to the value given in the first cell of the row in the table above whos
e second cell is a case-sensitive match for the new value."); |
| 51 run("textCue.vertical = 'RL'"); | 51 run("textCue.vertical = 'RL'"); |
| 52 testExpected("textCue.vertical", ""); | 52 testExpected("textCue.vertical", ""); |
| 53 run("textCue.vertical = 'rl'"); | 53 run("textCue.vertical = 'rl'"); |
| 54 testExpected("textCue.vertical", "rl"); | 54 testExpected("textCue.vertical", "rl"); |
| 55 | 55 |
| 56 consoleWrite(""); | 56 consoleWrite(""); |
| 57 run("textCue.snapToLines = false"); | 57 run("textCue.snapToLines = false"); |
| 58 testExpected("textCue.snapToLines", false); | 58 testExpected("textCue.snapToLines", false); |
| 59 | 59 |
| 60 logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/mu
ltipage/the-video-element.html#dom-texttrackcue-line", | 60 logSpecURL("http://dev.w3.org/html5/webvtt/#dfn-vttcue-line", |
| 61 "On setting, if the text track cue snap-to-lines fla
g is not set, and the new value is negative or greater than 100, then throw an I
ndexSizeError exception."); | 61 "On setting, the text track cue line position must be
set to the new value; if the new value is the string 'auto', then it must be in
terpreted as the special value auto."); |
| 62 testDOMException("textCue.line = -2", "DOMException.INDEX_SIZE_E
RR"); | 62 testExpected("textCue.line", "auto"); |
| 63 testDOMException("textCue.line = 102", "DOMException.INDEX_SIZE_
ERR"); | 63 testException("textCue.line = 'gazonk'", '"TypeError: Failed to
set the \'line\' property on \'VTTCue\': \'gazonk\' is not a valid enum value."'
); |
| 64 testExpected("textCue.line", -1); | 64 testExpected("textCue.line", "auto"); |
| 65 run("textCue.line = 42"); | 65 run("textCue.line = 42"); |
| 66 testExpected("textCue.line", 42); | 66 testExpected("textCue.line", 42); |
| 67 run("textCue.line = -2"); |
| 68 testExpected("textCue.line", -2); |
| 69 run("textCue.line = 102"); |
| 70 testExpected("textCue.line", 102); |
| 67 run("textCue.snapToLines = true"); | 71 run("textCue.snapToLines = true"); |
| 68 run("textCue.line = -2"); | 72 run("textCue.line = -2"); |
| 69 testExpected("textCue.line", -2); | 73 testExpected("textCue.line", -2); |
| 70 run("textCue.line = 102"); | 74 run("textCue.line = 102"); |
| 71 testExpected("textCue.line", 102); | 75 testExpected("textCue.line", 102); |
| 72 | 76 |
| 73 logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/mu
ltipage/the-video-element.html#dom-texttrackcue-line", | 77 logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/mu
ltipage/the-video-element.html#dom-texttrackcue-line", |
| 74 "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."); | 78 "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."); |
| 75 testDOMException("textCue.position = -200", "DOMException.INDEX_
SIZE_ERR"); | 79 testDOMException("textCue.position = -200", "DOMException.INDEX_
SIZE_ERR"); |
| 76 testDOMException("textCue.position = 110", "DOMException.INDEX_S
IZE_ERR"); | 80 testDOMException("textCue.position = 110", "DOMException.INDEX_S
IZE_ERR"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 | 101 |
| 98 </script> | 102 </script> |
| 99 </head> | 103 </head> |
| 100 <body> | 104 <body> |
| 101 <p>Tests modifying attributes of a VTTCue</p> | 105 <p>Tests modifying attributes of a VTTCue</p> |
| 102 <video controls> | 106 <video controls> |
| 103 <track id="captions" src="captions-webvtt/captions.vtt" kind="captio
ns" onload="trackLoaded()" default> | 107 <track id="captions" src="captions-webvtt/captions.vtt" kind="captio
ns" onload="trackLoaded()" default> |
| 104 </video> | 108 </video> |
| 105 </body> | 109 </body> |
| 106 </html> | 110 </html> |
| OLD | NEW |