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

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

Issue 8802030: Introduce new PyAuto test to measure EPT, TTP metrics. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixup www-data path. Created 9 years 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
« no previous file with comments | « no previous file | chrome/test/functional/media/media_constrained_network_perf.py » ('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_constrained_network_perf to record perf metrics. -->
2 <!DOCTYPE html>
3 <html lang="en-US">
4 <head>
5 <title>Constrained Video Test</title>
6 </head>
7
8 <body>
9 <video/>
10 </body>
11
12 <script type="text/javascript">
13 var video = document.querySelector('video');
14
15 // Tracks time when page load completes and src= is set.
16 var loadTime;
17
18 // Tracks time when playback starts.
19 var startTime;
20
21 // Metrics to record. See media_constrained_network_perf for more details.
22 // Use -1 to indicate that we haven't recorded these values yet. The PyAuto
23 // controller will poll for these values until they are each >= 0.
24 var extra_play_percentage = -1, time_to_playback = -1;
25
26 video.addEventListener('playing', function(event) {
27 startTime = new Date().getTime();
28
29 time_to_playback = Math.max(0, startTime - loadTime);
30 }, false);
31
32 video.addEventListener('ended', function(event) {
33 playTime = new Date().getTime() - startTime;
34 durMs = video.duration * 1000;
35
36 extra_play_percentage = Math.max(0, (playTime - durMs) / durMs)
37 }, false);
38
39 // Called by the PyAuto controller to initiate testing.
40 function startTest(src) {
41 loadTime = new Date().getTime();
42 video.src = src
43 video.play();
44
45 if (window.domAutomationController)
46 window.domAutomationController.send(true);
47 }
48 </script>
49 </html>
OLDNEW
« no previous file with comments | « no previous file | chrome/test/functional/media/media_constrained_network_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698