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

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

Issue 16158006: Defining the test expectations object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | « tools/telemetry/telemetry/page/test_expectations_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/test.py
diff --git a/tools/telemetry/telemetry/test.py b/tools/telemetry/telemetry/test.py
index f48a8823193c9c1cb83a2e4949fad32af8443575..9e064868a34a5872529c22b16ad38b609bccc4e8 100644
--- a/tools/telemetry/telemetry/test.py
+++ b/tools/telemetry/telemetry/test.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from telemetry.page import page_runner
from telemetry.page import page_set
+from telemetry.page import test_expectations
from telemetry.page import page_test
@@ -25,7 +26,8 @@ class Test(object):
test = self.test()
ps = self.CreatePageSet(options)
- results = page_runner.Run(test, ps, options)
+ expectations = self.CreateExpectations(ps)
+ results = page_runner.Run(test, ps, expectations, options)
results.PrintSummary()
return len(results.failures) + len(results.errors)
@@ -37,3 +39,14 @@ class Test(object):
"""
assert hasattr(self, 'page_set'), 'This test has no "page_set" attribute.'
return page_set.PageSet.FromFile(self.page_set)
+
+ def CreateExpectations(self, ps): # pylint: disable=W0613
+ """Get the expectations this test will run with.
+
+ By default, it will create an empty expectations set. Override to generate
+ custom expectations.
+ """
+ if hasattr(self, 'expectations'):
+ return self.expectations
+ else:
+ return test_expectations.TestExpectations()
« no previous file with comments | « tools/telemetry/telemetry/page/test_expectations_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698