OLD | NEW |
1 <p>Test that the media element is in correct state after load fails.</p> | 1 <p>Test that the media element is in correct state after load fails.</p> |
2 <video controls></video> | 2 <video controls></video> |
| 3 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 4 (Please avoid writing new tests using video-test.js) --> |
3 <script src=video-test.js></script> | 5 <script src=video-test.js></script> |
4 <script> | 6 <script> |
5 | 7 |
6 consoleWrite(""); | 8 consoleWrite(""); |
7 testExpected("video.error", null); | 9 testExpected("video.error", null); |
8 | 10 |
9 waitForEventAndTest("canplaythrough", "false"); | 11 waitForEventAndTest("canplaythrough", "false"); |
10 | 12 |
11 waitForEvent("error", function () { | 13 waitForEvent("error", function () { |
12 testExpected("video.error", null, "!="); | 14 testExpected("video.error", null, "!="); |
13 testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)
; | 15 testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)
; |
14 | 16 |
15 testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE); | 17 testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE); |
16 | 18 |
17 testExpected("isNaN(video.duration)", true); | 19 testExpected("isNaN(video.duration)", true); |
18 testExpected("video.currentTime", 0); | 20 testExpected("video.currentTime", 0); |
19 testExpected("video.buffered.length", 0); | 21 testExpected("video.buffered.length", 0); |
20 testExpected("video.seekable.length", 0); | 22 testExpected("video.seekable.length", 0); |
21 testExpected("video.buffered.length", 0); | 23 testExpected("video.buffered.length", 0); |
22 endTest(); | 24 endTest(); |
23 }); | 25 }); |
24 | 26 |
25 video.src = "content/does-not-exist.mpeg"; | 27 video.src = "content/does-not-exist.mpeg"; |
26 consoleWrite(""); | 28 consoleWrite(""); |
27 </script> | 29 </script> |
OLD | NEW |