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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/media/html/media_constrained_network.html
diff --git a/chrome/test/data/media/html/media_constrained_network.html b/chrome/test/data/media/html/media_constrained_network.html
new file mode 100644
index 0000000000000000000000000000000000000000..c20f7726471af1a570c63301d7b5f52d2d4454c6
--- /dev/null
+++ b/chrome/test/data/media/html/media_constrained_network.html
@@ -0,0 +1,49 @@
+<!-- Used by media_constrained_network_perf to record perf metrics. -->
+<!DOCTYPE html>
+<html lang="en-US">
+ <head>
+ <title>Constrained Video Test</title>
+ </head>
+
+ <body>
+ <video/>
+ </body>
+
+ <script type="text/javascript">
+ var video = document.querySelector('video');
+
+ // Tracks time when page load completes and src= is set.
+ var loadTime;
+
+ // Tracks time when playback starts.
+ var startTime;
+
+ // Metrics to record. See media_constrained_network_perf for more details.
+ // Use -1 to indicate that we haven't recorded these values yet. The PyAuto
+ // controller will poll for these values until they are each >= 0.
+ var extra_play_percentage = -1, time_to_playback = -1;
+
+ video.addEventListener('playing', function(event) {
+ startTime = new Date().getTime();
+
+ time_to_playback = Math.max(0, startTime - loadTime);
+ }, false);
+
+ video.addEventListener('ended', function(event) {
+ playTime = new Date().getTime() - startTime;
+ durMs = video.duration * 1000;
+
+ extra_play_percentage = Math.max(0, (playTime - durMs) / durMs)
+ }, false);
+
+ // Called by the PyAuto controller to initiate testing.
+ function startTest(src) {
+ loadTime = new Date().getTime();
+ video.src = src
+ video.play();
+
+ if (window.domAutomationController)
+ window.domAutomationController.send(true);
+ }
+ </script>
+</html>
« 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