eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 3 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 4 | <script src=video-test.js></script> |
| 5 | <script> |
| 6 | function testOnLoadStart() |
| 7 | { |
| 8 | consoleWrite("EVENT(" + event.type + ")"); |
| 9 | testExpected("!event.lengthComputable", true); |
| 10 | testExpected("event.total", 0); |
| 11 | testExpected("event.loaded", 0); |
| 12 | } |
| 13 | |
| 14 | function testOnLoad() |
| 15 | { |
| 16 | consoleWrite("EVENT(" + event.type + ")"); |
| 17 | testExpected("event.lengthComputable", true); |
| 18 | testExpected("event.loaded", 0, '>'); |
| 19 | var allowedTotalBytes = [188483, 192844]; |
| 20 | if (event.total == allowedTotalBytes[0] || event.total == allowedTotalBytes[1]) |
| 21 | consoleWrite("SUCCESS: event.total is " + allowedTotalBytes[0] + " or " + allowedTotalBytes[1] + " (Playback engine specific)"); |
| 22 | else |
| 23 | consoleWrite("FAIL: event.total should not be " + event.total + " (should be " + allowedTotalBytes[0] + " or " + allowedTotalBytes[1] + ")"); |
| 24 | endTest(); |
| 25 | } |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 26 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 27 | function start() |
| 28 | { |
| 29 | findMediaElement(); |
| 30 | } |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 31 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 32 | </script> |
| 33 | </head> |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 34 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 35 | <body onload="start()"> |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 36 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 37 | <video controls src="content/test.mp4" onloadstart="testOnLoadStart()" onload="testOnLoad()"> |
| 38 | </video> |
eric.carlson@apple.com | 656a763 | 2009-03-04 01:06:50 +0000 | [diff] [blame] | 39 | |
eric.carlson@apple.com | db9b17f | 2009-06-23 14:49:19 +0000 | [diff] [blame] | 40 | </body> |
| 41 | </html> |