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

Unified Diff: tools/telemetry/telemetry/page/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/page_measurement_results_unittest.py
===================================================================
--- tools/telemetry/telemetry/page/page_measurement_results_unittest.py (revision 222891)
+++ tools/telemetry/telemetry/page/page_measurement_results_unittest.py (working copy)
@@ -4,10 +4,16 @@
import os
import unittest
+from telemetry.core import util
from telemetry.page import 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",
@@ -33,7 +39,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 PageMeasurementResultsTest(unittest.TestCase):
@@ -84,7 +91,9 @@
measurement_results.WillMeasurePage(test_page_set.pages[1])
self.assertRaises(
AssertionError,
- lambda: measurement_results.Add('a', 'seconds', 3, data_type='histogram'))
+ lambda: measurement_results.Add(
+ 'a', 'seconds', 3,
+ data_type=perf_result_data_type.HISTOGRAM))
def test_basic_summary_all_pages_fail(self):
"""If all pages fail, no summary is printed."""
« no previous file with comments | « tools/telemetry/telemetry/page/page_measurement_results.py ('k') | tools/telemetry/telemetry/page/page_measurement_value.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698