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

Side by Side Diff: chrome/test/data/media/html/media_event.html

Issue 9666032: Cleanup deprecated PyAuto media tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update year. Created 8 years, 9 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 | « chrome/test/data/media/csv/testscenario.csv ('k') | chrome/test/data/media/html/media_fps.html » ('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 <!--
2 This HTML file contains a div for a player which is used for event testing
3 (chrome/test/functional/media_event_*.py).
4 The query string should contain the following information:
5 tag (required): HTML video/audio tag.
6 video file (required): video file name.
7 t (optional): if specified, disables the media cache.
8 actions (optional): add a list of triples (time, action, action_argument)
9 delimited by '|'. For example, '3000|seek|5000' means 'at second 3, seek
10 to second 5'. Possible actions are 'play', 'pause', 'seek', or
11 'ratechange'. Time and action_arugment is in milliseconds. 'play' and
12 'pause' should have dummy action_argument, which is ignored.
13
14 Example: "media_event.html?tag=video&media=foo.webm&t=t&actions=3000|seek|5000"
15 -->
16 <html>
17 <body>
18 <div id='player_container'></div>
19 <script type='text/javascript' src='player.js'></script>
20 <script>
21 var events = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied',
22 'ended', 'error', 'load', 'loadeddata', 'loadedmetadata',
23 'loadstart', 'pause', 'play', 'playing', 'progress',
24 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend',
25 'timeupdate', 'volumechange', 'waiting',
26 'cuechange', 'enter', 'exit', 'change'];
27
28 var startTime = 0
29
30 var table = document.createElement('table');
31 table.id = 'event';
32 document.body.appendChild(table);
33
34 function recordEventTime(evt) {
35 // Record the time when an event happens.
36 var time = new Date().getTime() - startTime
37 document.getElementById(evt.type).innerHTML += time + ' '
38 }
39
40 var player = document.getElementById('player');
41
42 for (var event in events) {
43 var row = document.createElement('tr');
44 var eventNameColumn = document.createElement('td');
45 eventNameColumn.innerHTML = events[event];
46 var eventValueColumn = document.createElement('td');
47 eventValueColumn.innerHTML = '';
48 eventValueColumn.id = events[event];
49 row.appendChild(eventNameColumn);
50 row.appendChild(eventValueColumn);
51 table.appendChild(row)
52 player.addEventListener(events[event], recordEventTime, false);
53 }
54
55 if (ok) {
56 startTime = new Date().getTime();
57 player.play();
58 }
59 </script>
60 </body>
61 </html>
62
OLDNEW
« no previous file with comments | « chrome/test/data/media/csv/testscenario.csv ('k') | chrome/test/data/media/html/media_fps.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698