OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="media-file.js"></script> | 3 <script src="media-file.js"></script> |
| 4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> |
4 <script src="video-test.js"></script> | 6 <script src="video-test.js"></script> |
5 <script> | 7 <script> |
6 function start() | 8 function start() |
7 { | 9 { |
8 findMediaElement(); | 10 findMediaElement(); |
9 video.src = findMediaFile("video", "content/test"); | 11 video.src = findMediaFile("video", "content/test"); |
10 | 12 |
11 testExpected("video.preload", "none"); | 13 testExpected("video.preload", "none"); |
12 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); | 14 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); |
13 waitForEventAndEnd('loadedmetadata'); | 15 waitForEventAndEnd('loadedmetadata'); |
14 | 16 |
15 // Wait 250ms before load()ing to make sure setting src does not
kick off the load | 17 // Wait 250ms before load()ing to make sure setting src does not
kick off the load |
16 // (i.e. preload=none should still be respected). | 18 // (i.e. preload=none should still be respected). |
17 setTimeout(load, 250); | 19 setTimeout(load, 250); |
18 } | 20 } |
19 function load() | 21 function load() |
20 { | 22 { |
21 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); | 23 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); |
22 run("video.load()"); | 24 run("video.load()"); |
23 } | 25 } |
24 </script> | 26 </script> |
25 </head> | 27 </head> |
26 | 28 |
27 <body> | 29 <body> |
28 <video preload="none"></video> | 30 <video preload="none"></video> |
29 <p>Test that an explicit load() to a media element whose preload is set
to "none" still loads the video.</p> | 31 <p>Test that an explicit load() to a media element whose preload is set
to "none" still loads the video.</p> |
30 <script>start();</script> | 32 <script>start();</script> |
31 </body> | 33 </body> |
32 </html> | 34 </html> |
OLD | NEW |