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

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: Split measurement JS from action JS. Wrap JS access in Py class. Add more unit tests. Created 7 years, 6 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
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..358b8d7585f18f65eb296b698d5390c34e0a3f42
--- /dev/null
+++ b/tools/perf/perf_tools/media_measurement.py
@@ -0,0 +1,32 @@
+# 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)
+
+ def MeasurePage(self, page, tab, results):
+ """Measure the page's performance."""
+ self.metrics.ReportCollectedMetrics(results)

Powered by Google App Engine
This is Rietveld 408576698