Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: chrome/test/data/media/html/media_basic_playback.html

Issue 9290008: Introduce new basic playback test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes. PYAUTO_TESTS. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/media/html/utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f5df358f0e90cd146080c819b0707720d96c53d4
--- /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></video>
+ </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 = [];
+
+ function logEvent(evt) {
+ events.push(evt.type);
+ }
+
+ 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();
+ </script>
+</html>
« no previous file with comments | « no previous file | chrome/test/data/media/html/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698