Chromium Code Reviews| Index: chrome/test/data/media/html/media_basic_playback.html |
| diff --git a/chrome/test/data/media/html/media_basic_playback.html b/chrome/test/data/media/html/media_basic_playback.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..91f7f136c86f524d781452a34cb0e4c0d9324853 |
| --- /dev/null |
| +++ b/chrome/test/data/media/html/media_basic_playback.html |
| @@ -0,0 +1,51 @@ |
| +<!-- Used by media_basic_playback to verify basic playback. --> |
| +<!DOCTYPE html> |
| +<html lang="en-US"> |
| + <head> |
| + <title>Basic Media Playback Test</title> |
| + </head> |
| + |
| + <body> |
| + <video autoplay preload controls/> |
|
scherkus (not reviewing)
2012/01/26 21:52:16
<video> doesn't use /> tags
please change to <vid
DaleCurtis
2012/01/26 22:11:36
Done.
|
| + </body> |
| + |
| + <script type="text/javascript" src="utils.js"></script> |
| + <script type="text/javascript"> |
| + var video = document.querySelector('video'); |
| + |
| + // Used to keep track of events. |
| + var events = [] |
|
scherkus (not reviewing)
2012/01/26 21:52:16
missing ;
DaleCurtis
2012/01/26 22:11:36
Done.
|
| + |
| + function logEvent(evt) { |
| + events.push(evt.type) |
|
scherkus (not reviewing)
2012/01/26 21:52:16
missing ;
DaleCurtis
2012/01/26 22:11:36
Done.
|
| + } |
| + |
| + video.addEventListener('ended', function(event) { |
| + firstEndedEvent = events.indexOf('ended') < 0; |
| + logEvent(event); |
| + |
| + // At the end of the first playback, seek near end and replay. |
| + if (firstEndedEvent) { |
| + video.currentTime = 0.8 * video.duration; |
| + video.play(); |
| + } else { |
| + // PyAuto has trouble with arrays, so convert to string. |
| + events = events.join(','); |
| + |
| + // Notify PyAuto that we've completed testing. Send test of currentTime |
| + // at the same time for efficiency. |
| + window.domAutomationController.send( |
| + video.currentTime == video.duration); |
| + } |
| + }, false); |
| + |
| + video.addEventListener('playing', logEvent, false); |
| + video.addEventListener('error', logEvent, false); |
| + video.addEventListener('abort', logEvent, false); |
| + video.addEventListener('seeked', logEvent, false); |
| + |
| + // Retrieve video file name from URL query parameters. See utils.js. |
| + video.src = '../' + QueryString.media; |
| + video.play() |
|
scherkus (not reviewing)
2012/01/26 21:52:16
missing ;
DaleCurtis
2012/01/26 22:11:36
Done.
|
| + </script> |
| +</html> |