OLD | NEW |
1 <video controls></video> | 1 <!DOCTYPE html> |
2 <script src=media-file.js></script> | 2 <title>Test that setting currentTime changes the time, and setting invalid value
s throw exceptions.</title> |
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 3 <script src="../resources/testharness.js"></script> |
4 (Please avoid writing new tests using video-test.js) --> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src=video-test.js></script> | 5 <script src="media-file.js"></script> |
| 6 <video></video> |
6 <script> | 7 <script> |
7 waitForEvent('canplaythrough', | 8 async_test(function(t) { |
8 function () { | 9 var video = document.querySelector("video"); |
9 testException("video.currentTime = -Infinity", '"TypeError: Failed to se
t the \'currentTime\' property on \'HTMLMediaElement\': The provided double valu
e is non-finite."'); | 10 |
10 testException("video.currentTime = Infinity", '"TypeError: Failed to set
the \'currentTime\' property on \'HTMLMediaElement\': The provided double value
is non-finite."'); | 11 video.oncanplaythrough = t.step_func_done(function () { |
11 testException("video.currentTime = NaN", '"TypeError: Failed to set the
\'currentTime\' property on \'HTMLMediaElement\': The provided double value is n
on-finite."'); | 12 assert_throws(new TypeError, function() { video.currentTime = -Infinity;
}); |
| 13 assert_throws(new TypeError, function() { video.currentTime = Infinity;
}); |
| 14 assert_throws(new TypeError, function() { video.currentTime = NaN; }); |
12 video.currentTime = 1.5; | 15 video.currentTime = 1.5; |
13 testExpected("video.currentTime.toFixed(1)", 1.5); | 16 assert_equals(video.currentTime, 1.5); |
14 video.play(); | 17 video.play(); |
15 video.currentTime = 3.1; | 18 video.currentTime = 3.1; |
16 testExpected("video.currentTime.toFixed(1)", 3.1); | 19 assert_equals(video.currentTime, 3.1); |
17 endTest(); | |
18 }); | 20 }); |
| 21 |
19 video.src = findMediaFile("video", "content/test"); | 22 video.src = findMediaFile("video", "content/test"); |
20 </script> | 23 }); |
| 24 </script> |
OLD | NEW |