| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description("Verify that TextTrackCue exceptions are properly messaged t
o developers."); | 8 description("Verify that TextTrackCue exceptions are properly messaged t
o developers."); |
| 9 | 9 |
| 10 var cue = new TextTrackCue(0, 0, "Test."); | 10 var cue = new VTTCue(0, 0, "Test."); |
| 11 | 11 |
| 12 function testInfinityAndNaN(property) { | 12 function testInfinityAndNaN(property) { |
| 13 shouldThrow("cue." + property + " = Number.NaN;"); | 13 shouldThrow("cue." + property + " = Number.NaN;"); |
| 14 shouldThrow("cue." + property + " = Number.POSITIVE_INFINITY;"); | 14 shouldThrow("cue." + property + " = Number.POSITIVE_INFINITY;"); |
| 15 shouldThrow("cue." + property + " = Number.NEGATIVE_INFINITY;"); | 15 shouldThrow("cue." + property + " = Number.NEGATIVE_INFINITY;"); |
| 16 } | 16 } |
| 17 | 17 |
| 18 function testPercentage(property) { | 18 function testPercentage(property) { |
| 19 shouldThrow("cue." + property + " = -1;"); | 19 shouldThrow("cue." + property + " = -1;"); |
| 20 shouldThrow("cue." + property + " = 101;"); | 20 shouldThrow("cue." + property + " = 101;"); |
| 21 } | 21 } |
| 22 | 22 |
| 23 testInfinityAndNaN("startTime"); | 23 testInfinityAndNaN("startTime"); |
| 24 testInfinityAndNaN("endTime"); | 24 testInfinityAndNaN("endTime"); |
| 25 | 25 |
| 26 shouldThrow("cue.vertical = 'Invalid!';"); | 26 shouldThrow("cue.vertical = 'Invalid!';"); |
| 27 | 27 |
| 28 cue.snapToLines = false; | 28 cue.snapToLines = false; |
| 29 testPercentage("line"); | 29 testPercentage("line"); |
| 30 | 30 |
| 31 testPercentage("position"); | 31 testPercentage("position"); |
| 32 testPercentage("size"); | 32 testPercentage("size"); |
| 33 | 33 |
| 34 shouldThrow("cue.align = 'Invalid!';"); | 34 shouldThrow("cue.align = 'Invalid!';"); |
| 35 </script> | 35 </script> |
| 36 </body> | 36 </body> |
| 37 </html> | 37 </html> |
| OLD | NEW |