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

Unified Diff: tools/telemetry/telemetry/page/page_measurement.py

Issue 385253002: Update files in telemetry/page/ to use results.AddValue() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | tools/telemetry/telemetry/page/page_measurement_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/page_measurement.py
diff --git a/tools/telemetry/telemetry/page/page_measurement.py b/tools/telemetry/telemetry/page/page_measurement.py
index e3d931c2143463fdd8765236ff3abe15cea6b78e..72d87ea2e1f84347b88f6525509f4318ac2c5973 100644
--- a/tools/telemetry/telemetry/page/page_measurement.py
+++ b/tools/telemetry/telemetry/page/page_measurement.py
@@ -20,7 +20,8 @@ class PageMeasurement(page_test.PageTest):
def MeasurePage(self, page, tab, results):
body_child_count = tab.EvaluateJavaScript(
'document.body.children.length')
- results.Add('body_children', 'count', body_child_count)
+ results.AddValue(scalar.ScalarValue(
+ page, 'body_children', 'count', body_child_count))
if __name__ == '__main__':
page_measurement.Main(BodyChildElementMeasurement())
@@ -34,7 +35,8 @@ class PageMeasurement(page_test.PageTest):
def MeasurePage(self, page, tab, results):
body_child_count = tab.EvaluateJavaScript(
'document.querySelector('%s').children.length')
- results.Add('children', 'count', child_count)
+ results.AddValue(scalar.ScalarValue(
+ page, 'children', 'count', child_count))
is_action_name_to_run_optional determines what to do if action_name_to_run is
not empty but the page doesn't have that action. The page will run (without
@@ -77,7 +79,7 @@ class PageMeasurement(page_test.PageTest):
page is a page_set.Page
tab is an instance of telemetry.core.Tab
- Should call results.Add(name, units, value) for each result, or raise an
+ Should call results.AddValue(...) for each result, or raise an
exception on failure. The name and units of each Add() call must be
the same across all iterations. The name 'url' must not be used.
@@ -90,6 +92,7 @@ class PageMeasurement(page_test.PageTest):
res = tab.EvaluateJavaScript('2+2')
if res != 4:
raise Exception('Oh, wow.')
- results.Add('two_plus_two', 'count', res)
+ results.AddValue(scalar.ScalarValue(
+ page, 'two_plus_two', 'count', res))
"""
raise NotImplementedError()
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/page_measurement_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698