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

Unified Diff: tools/telemetry/telemetry/benchmark.py

Issue 386943007: Plumb Telemetry test name through to results object creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Got rid of unnecessary fake Created 6 years, 4 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_base.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/benchmark.py
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py
index 47477a35522dc4d1367f2e002041aba427a3cc61..e5fcd2af11f0b59bc59f5785d9f046e00a63241b 100644
--- a/tools/telemetry/telemetry/benchmark.py
+++ b/tools/telemetry/telemetry/benchmark.py
@@ -17,7 +17,7 @@ from telemetry.page import page_runner
from telemetry.page import page_set
from telemetry.page import page_test
from telemetry.page import test_expectations
-from telemetry.results import page_test_results
+from telemetry.results import results_options
from telemetry.util import cloud_storage
@@ -25,6 +25,14 @@ Disabled = decorators.Disabled
Enabled = decorators.Enabled
+class BenchmarkMetadata(object):
+ def __init__(self, name):
+ self._name = name
+
+ @property
+ def name(self):
+ return self._name
+
class Benchmark(command_line.Command):
"""Base class for a Telemetry benchmark.
@@ -62,26 +70,29 @@ class Benchmark(command_line.Command):
def CustomizeBrowserOptions(self, options):
"""Add browser options that are required by this benchmark."""
- def Run(self, args):
+ def GetMetadata(self):
+ return BenchmarkMetadata(self.Name())
+
+ def Run(self, finder_options):
"""Run this test with the given options."""
- self.CustomizeBrowserOptions(args.browser_options)
+ self.CustomizeBrowserOptions(finder_options.browser_options)
- test = self.PageTestClass()()
- test.__name__ = self.__class__.__name__
+ pt = self.PageTestClass()()
+ pt.__name__ = self.__class__.__name__
if hasattr(self, '_disabled_strings'):
- test._disabled_strings = self._disabled_strings
+ pt._disabled_strings = self._disabled_strings
if hasattr(self, '_enabled_strings'):
- test._enabled_strings = self._enabled_strings
+ pt._enabled_strings = self._enabled_strings
- ps = self.CreatePageSet(args)
+ ps = self.CreatePageSet(finder_options)
expectations = self.CreateExpectations(ps)
- self._DownloadGeneratedProfileArchive(args)
+ self._DownloadGeneratedProfileArchive(finder_options)
- results = page_test_results.PageTestResults()
+ results = results_options.CreateResults(self.GetMetadata(), finder_options)
try:
- results = page_runner.Run(test, ps, expectations, args)
+ page_runner.Run(pt, ps, expectations, finder_options, results)
except page_test.TestNotSupportedOnPlatformFailure as failure:
logging.warning(str(failure))
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/page_measurement_unittest_base.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698