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

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

Issue 641823004: telemetry: Allow page tests to be configured via constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Add debug output to figure out why pixel tests fail on bots. Created 6 years, 2 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_test.py
diff --git a/tools/telemetry/telemetry/page/page_test.py b/tools/telemetry/telemetry/page/page_test.py
index 28282024440946b9755f4930d6df609739af779b..a92c7c1d24964daf26179f21af95f6b2ab74d160 100644
--- a/tools/telemetry/telemetry/page/page_test.py
+++ b/tools/telemetry/telemetry/page/page_test.py
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from telemetry.core import command_line
from telemetry.page import test_expectations
from telemetry.page.actions import action_runner as action_runner_module
@@ -23,7 +22,7 @@ class MeasurementFailure(Failure):
designed-for problem."""
-class PageTest(command_line.Command):
+class PageTest(object):
"""A class styled on unittest.TestCase for creating page-specific tests.
Test should override ValidateAndMeasurePage to perform test
@@ -98,6 +97,14 @@ class PageTest(command_line.Command):
# _exit_requested is set to true when the test requests an early exit.
self._exit_requested = False
+ def AddCommandLineArgs(self, parser):
+ """Override to accept custom command-line arguments."""
+
+ def ProcessCommandLineArgs(self, parser, args):
+ """Override to process command-line arguments.
+
+ We pass in parser so we can call parser.error()."""
+
@classmethod
def SetArgumentDefaults(cls, parser):
parser.set_defaults(**cls.options)
@@ -144,11 +151,6 @@ class PageTest(command_line.Command):
def max_failures(self, count):
self._max_failures = count
- def Run(self, args):
- # Define this method to avoid pylint errors.
- # TODO(dtu): Make this actually run the test with args.page_set.
- pass
-
def RestartBrowserBeforeEachPage(self):
""" Should the browser be restarted for the page?
« no previous file with comments | « tools/telemetry/telemetry/benchmark_runner.py ('k') | tools/telemetry/telemetry/web_perf/timeline_based_measurement.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698