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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/media/html/utils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!-- Used by media_basic_playback to verify basic playback. -->
2 <!DOCTYPE html>
3 <html lang="en-US">
4 <head>
5 <title>Basic Media Playback Test</title>
6 </head>
7
8 <body>
9 <video autoplay preload controls></video>
10 </body>
11
12 <script type="text/javascript" src="utils.js"></script>
13 <script type="text/javascript">
14 var video = document.querySelector('video');
15
16 // Used to keep track of events.
17 var events = [];
18
19 function logEvent(evt) {
20 events.push(evt.type);
21 }
22
23 video.addEventListener('ended', function(event) {
24 firstEndedEvent = events.indexOf('ended') < 0;
25 logEvent(event);
26
27 // At the end of the first playback, seek near end and replay.
28 if (firstEndedEvent) {
29 video.currentTime = 0.8 * video.duration;
30 video.play();
31 } else {
32 // PyAuto has trouble with arrays, so convert to string.
33 events = events.join(',');
34
35 // Notify PyAuto that we've completed testing. Send test of currentTime
36 // at the same time for efficiency.
37 window.domAutomationController.send(
38 video.currentTime == video.duration);
39 }
40 }, false);
41
42 video.addEventListener('playing', logEvent, false);
43 video.addEventListener('error', logEvent, false);
44 video.addEventListener('abort', logEvent, false);
45 video.addEventListener('seeked', logEvent, false);
46
47 // Retrieve video file name from URL query parameters. See utils.js.
48 video.src = '../' + QueryString.media;
49 video.play();
50 </script>
51 </html>
OLDNEW
« 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