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

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

Issue 22754003: Refactor BenchmarkResult.Add to take enum for data_type (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 3 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/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py
===================================================================
--- tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py (revision 222891)
+++ tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py (working copy)
@@ -4,10 +4,15 @@
import os
import unittest
+from telemetry.core import util
from telemetry.page import buildbot_page_measurement_results
from telemetry.page import page_set
-from telemetry.page import perf_tests_helper
+# Get build scripts into our path.
+util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'util', 'lib')
+from common import perf_result_data_type # pylint: disable=F0401
+from common import perf_tests_results_helper # pylint: disable=F0401
+
def _MakePageSet():
return page_set.PageSet.FromDict({
"description": "hello",
@@ -26,7 +31,8 @@
self.results = []
def _PrintPerfResult(self, *args):
- res = perf_tests_helper.PrintPerfResult(*args, print_to_stdout=False)
+ res = perf_tests_results_helper.PrintPerfResult(*args,
+ print_to_stdout=False)
self.results.append(res)
class BuildbotPageMeasurementResultsTest(unittest.TestCase):
@@ -256,13 +262,13 @@
measurement_results.WillMeasurePage(test_page_set.pages[0])
measurement_results.Add('a', 'units',
'{"buckets": [{"low": 1, "high": 2, "count": 1}]}',
- data_type='histogram')
+ data_type=perf_result_data_type.HISTOGRAM)
measurement_results.DidMeasurePage()
measurement_results.WillMeasurePage(test_page_set.pages[1])
measurement_results.Add('a', 'units',
'{"buckets": [{"low": 2, "high": 3, "count": 1}]}',
- data_type='histogram')
+ data_type=perf_result_data_type.HISTOGRAM)
measurement_results.DidMeasurePage()
measurement_results.PrintSummary()

Powered by Google App Engine
This is Rietveld 408576698