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

Side by Side Diff: chrome/test/data/media/html/media_fps.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
OLDNEW
(Empty)
1 <!--
2 This HTML file contains a div for a player which is used for FPS (frame per seco nd)
3 testing (chrome/test/functional/media_fps.py).
4 The query string should contain the following information:
5 tag (optional): HTML video/audio tag (default is video).
6 media (required): media file name.
7 t (optional): if specified, disables the media cache.
8
9 Example: "media_fps.html?tag=video&media=foo.webm&t=t"
10 -->
11 <html>
12 <body>
13 <div id='player_container'></div>
14 <div id='console'></div>
15 <br>
16 <div id='history'></div>
17 <script type='text/javascript' src='player.js'></script>
18 <script>
19 var previous_play_time = 0;
20 var previous_clock_time = 0;
21 var previous_framecount = 0;
22 var previous_dropcount = 0;
23 var start_clock_time = 0;
24
25 function timeUpdateHandler() {
26 // Get FPS information and print it to the console.
27 var container = document.getElementById('console');
28 var current_play_time = player.currentTime;
29 var current_clock_time = new Date().getTime();
30 var current_clock_elapsed_time = (current_clock_time - start_clock_time)
31 / 1000;
32 var current_framecount = player.webkitDecodedFrameCount;
33 var current_dropcount = player.webkitDroppedFrameCount;
34 var delta_play_time = current_play_time - previous_play_time;
35 var delta_clock_time = current_clock_time - previous_clock_time;
36 var delta_frame = current_framecount - previous_framecount;
37 var delta_drop = current_dropcount - previous_dropcount;
38 var play_fps = delta_frame / delta_play_time;
39 var clock_fps = delta_frame / delta_clock_time * 1000;
40 container.innerHTML =
41 '<div id="play_time">player.currentTime:' + current_play_time +
42 '</div>' + '<div id="clock_time">clock_time:' +
43 current_clock_elapsed_time + '</div>' +
44 '<div id="play_fps">play_fps:' + play_fps + '</div>' +
45 '<div id="clock_fps">clock_fps:' + clock_fps + '</div>' +
46 '<div id="drop">dropped frame:' + delta_drop + '</div>';
47 var history = document.getElementById('history');
48 history.innerHTML += current_play_time + ' ' +
49 current_clock_elapsed_time + ' ' + play_fps +
50 ' ' + clock_fps + ' ' + delta_drop + '<br>';
51 previous_play_time = current_play_time;
52 previous_clock_time = current_clock_time;
53 previous_framecount = current_framecount;
54 previous_dropcount = current_dropcount;
55 }
56
57 tid = setInterval(timeUpdateHandler, 500);
58 InstallEventHandler('ended',
59 'document.title = "END"; clearInterval(tid);');
60 start_clock_time = new Date().getTime();
61
62 if (ok) {
63 player.play();
64 }
65 </script>
66
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/media/html/media_event.html ('k') | chrome/test/data/media/html/media_perf.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698