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

Unified Diff: tools/perf/perf_tools/media_measurement.py

Issue 16854013: Telemetry media_measurement plus play action and tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove media files (submitted separately) Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/page_sets/tough_video_cases/video.html ('k') | tools/perf/perf_tools/media_metrics.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/media_measurement.py
diff --git a/tools/perf/perf_tools/media_measurement.py b/tools/perf/perf_tools/media_measurement.py
new file mode 100644
index 0000000000000000000000000000000000000000..c6cd47f64c447562335200a6649ca2bc77936fdb
--- /dev/null
+++ b/tools/perf/perf_tools/media_measurement.py
@@ -0,0 +1,33 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Media measurement class gathers media related metrics on a page set.
+
+Media metrics recorded are controlled by media_metrics.js. At the end of the
+test each metrics for every media element in the page are reported.
+"""
+from perf_tools import media_metrics
+
+from telemetry.page import page_measurement
+
+
+class MediaMeasurement(page_measurement.PageMeasurement):
+ """Provide general video and audio metrics."""
+
+ def __init__(self):
+ super(MediaMeasurement, self).__init__('media_metrics')
+ self.metrics = None
+
+ def results_are_the_same_on_every_page(self):
+ """Results can vary from page to page based on media events taking place."""
+ return False
+
+ def DidNavigateToPage(self, page, tab):
+ """Override to do operations right after the page is navigated."""
+ self.metrics = media_metrics.MediaMetrics(tab)
+ self.metrics.Start()
+
+ def MeasurePage(self, page, tab, results):
+ """Measure the page's performance."""
+ self.metrics.StopAndGetResults(results)
« no previous file with comments | « tools/perf/page_sets/tough_video_cases/video.html ('k') | tools/perf/perf_tools/media_metrics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698