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

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: Documentation. 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
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..767e238d800c42c1dfb48708a0499d66984e437c
--- /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/>
+ </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 = []
+
+ video.addEventListener('ended', function(event) {
+ // At the end of the first playback, seek near end and replay.
+ if (events.indexOf('ended') < 0) {
+ video.currentTime = 0.8 * video.duration;
+ video.play();
+ logEvent(event);
Ami GONE FROM CHROMIUM 2012/01/25 17:58:48 Log the event *first*, which both removes doubts a
DaleCurtis 2012/01/25 23:59:25 Done.
+ } else {
+ logEvent(event);
+
+ // PyAuto has trouble with arrays, so convert to string.
+ events = events.join(',');
shadi 2012/01/25 19:30:04 How would PyAuto read "events" if some error occur
DaleCurtis 2012/01/25 23:59:25 It will time out and fail.
+
+ // Notify PyAuto that we've completed testing. Send test of currenTime
Ami GONE FROM CHROMIUM 2012/01/25 17:58:48 s/nT/ntT/
DaleCurtis 2012/01/25 23:59:25 Done.
+ // at the same time for efficiency.
+ window.domAutomationController.send(
+ video.currentTime == video.duration);
Ami GONE FROM CHROMIUM 2012/01/25 17:58:48 What happens if this fails?
DaleCurtis 2012/01/25 23:59:25 You mean the equality statement? The PyAuto portio
+ }
+ }, false);
+
+ video.addEventListener('playing', logEvent, false);
+ video.addEventListener('error', logEvent, false);
+ video.addEventListener('abort', logEvent, false);
+ video.addEventListener('seeked', logEvent, false);
+
+ function logEvent(evt) {
Ami GONE FROM CHROMIUM 2012/01/25 17:58:48 Move this above the text that uses it.
DaleCurtis 2012/01/25 23:59:25 Done.
+ events.push(evt.type)
+ }
+
+ // Retrieve video file name from URL query parameters. See utils.js.
+ video.src = '../' + QueryString.media;
+ video.play()
+ </script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698