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

Unified Diff: chrome/test/data/media/html/media_cn.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: Code review fixes. 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/data/media/roller.webm » ('j') | chrome/test/functional/media/media_cn_perf.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/media/html/media_cn.html
diff --git a/chrome/test/data/media/html/media_cn.html b/chrome/test/data/media/html/media_cn.html
new file mode 100644
index 0000000000000000000000000000000000000000..942715a0d9ff84749359356201950c5397c1cade
--- /dev/null
+++ b/chrome/test/data/media/html/media_cn.html
@@ -0,0 +1,49 @@
+<!-- Used by media_cn_perf to record EPT, TTP values for a specified video. -->
Ami GONE FROM CHROMIUM 2011/12/07 01:33:08 "cn" is China's country-level domain and confusing
DaleCurtis 2011/12/07 22:57:32 Done.
+<!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
Ami GONE FROM CHROMIUM 2011/12/07 01:33:08 missing semicolon.
DaleCurtis 2011/12/07 22:57:32 Done.
+
+ // Tracks time when playback starts.
+ var startTime;
+
+ // Metrics we want to record. See media_cn_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_time = -1, time_to_playback = -1;
Ami GONE FROM CHROMIUM 2011/12/07 01:33:08 s/play_time/play_percentage/ ?
DaleCurtis 2011/12/07 22:57:32 Done.
+
+ 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_time = 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/data/media/roller.webm » ('j') | chrome/test/functional/media/media_cn_perf.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698