diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 22:47:06 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 22:47:06 +0000 |
commit | 4b87e474248a7d635df9b48983c89f61f7f6d570 (patch) | |
tree | 081f3b749cd7d5cb6b9187eb3fe90380bc688134 /chrome/test | |
parent | dbcda9bb32b1753395ebd40e0a3df9f47c0c8998 (diff) | |
download | chromium_src-4b87e474248a7d635df9b48983c89f61f7f6d570.zip chromium_src-4b87e474248a7d635df9b48983c89f61f7f6d570.tar.gz chromium_src-4b87e474248a7d635df9b48983c89f61f7f6d570.tar.bz2 |
UI test for <video>
Simple ui test that goes through some test clips.
TEST=MediaTest.*
Review URL: http://codereview.chromium.org/125173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/data/media/bear.mp4 | bin | 0 -> 134641 bytes | |||
-rw-r--r-- | chrome/test/data/media/player.html | 46 |
2 files changed, 46 insertions, 0 deletions
diff --git a/chrome/test/data/media/bear.mp4 b/chrome/test/data/media/bear.mp4 Binary files differnew file mode 100644 index 0000000..f0b4707 --- /dev/null +++ b/chrome/test/data/media/bear.mp4 diff --git a/chrome/test/data/media/player.html b/chrome/test/data/media/player.html new file mode 100644 index 0000000..3b8fd9b --- /dev/null +++ b/chrome/test/data/media/player.html @@ -0,0 +1,46 @@ +<html> +<body> +<div id="player_container"></div> +<script> +var player = null; +function InstallEventHandler(event, action) { + player.addEventListener(event, function(e) { + eval(action); + }, false); +} + +// Parse the location and load the media file accordingly. +var url = window.location.href; +var url_parts = url.split('?'); + +// Make sure the URL is of the form "player.html?query". +var ok = false; +if (url_parts.length > 1) { + var query = url_parts[1]; + var query_parts = query.split('='); + if (query_parts.length == 2) { + var tag = query_parts[0]; + var media_url = query_parts[1]; + if (tag == 'audio' || tag == 'video') { + ok = true; + var container = document.getElementById('player_container'); + container.innerHTML = '<' + tag + ' controls id="player"></' + tag + '>'; + player = document.getElementById('player'); + + // Install event handlers. + InstallEventHandler('error', + 'document.title = "ERROR = " + player.error.code'); + InstallEventHandler('playing', 'document.title = "PLAYING"'); + + // Starts the player. + player.src = media_url; + player.play(); + } + } +} +if (!ok) { + document.title = 'FAILED'; +} +</script> +</body> +</html> |