OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src=../../media-resources/media-file.js></script> | 4 <script src=../../media-resources/media-file.js></script> |
| 5 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 6 (Please avoid writing new tests using video-test.js) --> |
5 <script src=../../media-resources/video-test.js></script> | 7 <script src=../../media-resources/video-test.js></script> |
6 <script> | 8 <script> |
7 var loadCount = 0; | 9 var loadCount = 0; |
8 | 10 |
9 if (window.testRunner) { | 11 if (window.testRunner) { |
10 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
11 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
12 } | 14 } |
13 | 15 |
14 function logEvent(event) | 16 function logEvent(event) |
15 { | 17 { |
16 consoleWrite("<br><b><em>'" + event.type + "'<" + "/em> event<"
+ "/b>"); | 18 consoleWrite("<br><b><em>'" + event.type + "'<" + "/em> event<"
+ "/b>"); |
17 } | 19 } |
18 | 20 |
19 function loadstart() | 21 function loadstart() |
20 { | 22 { |
21 logEvent(event); | 23 logEvent(event); |
22 | 24 |
23 if (++loadCount > 1) { | 25 if (++loadCount > 1) { |
24 consoleWrite('FAIL: loadstart fired more than once.'); | 26 consoleWrite('FAIL: loadstart fired more than once.'); |
25 endTest(); | 27 endTest(); |
26 return; | 28 return; |
27 } | 29 } |
28 | 30 |
29 consoleWrite("*** Showing confirm dialog..."); | 31 consoleWrite("*** Showing confirm dialog..."); |
30 confirm('I hope the movie continues to play!'); | 32 confirm('I hope the movie continues to play!'); |
31 } | 33 } |
32 | 34 |
(...skipping 22 matching lines...) Expand all Loading... |
55 <video controls | 57 <video controls |
56 oncanplaythrough="canplaythrough()" | 58 oncanplaythrough="canplaythrough()" |
57 onloadstart="loadstart()"> | 59 onloadstart="loadstart()"> |
58 </video> | 60 </video> |
59 <p>Make sure we don't reload a <video> element after a dialog is s
hown.<br> | 61 <p>Make sure we don't reload a <video> element after a dialog is s
hown.<br> |
60 Test this by loading a movie slowly and showing a dialog when a 'loadsta
rt' event <br> | 62 Test this by loading a movie slowly and showing a dialog when a 'loadsta
rt' event <br> |
61 handler is called. If the movie is reloaded when the dialog is "dismisse
d", another <br> | 63 handler is called. If the movie is reloaded when the dialog is "dismisse
d", another <br> |
62 'loadstart' event will be fired</p> | 64 'loadstart' event will be fired</p> |
63 </body> | 65 </body> |
64 </html> | 66 </html> |
65 | |
OLD | NEW |