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

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

Issue 637153002: telemetry: Remove command line args from page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress pylint E1003 Created 6 years, 1 month 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 478f4a2ba2d0cea964f6718e9c6dc2e22716639d..081ea9884cee6838cc335843bf2e1c508c2a9531 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
@@ -36,19 +35,6 @@ class PageTest(command_line.Command):
results.AddValue(scalar.ScalarValue(
page, 'body_children', 'count', body_child_count))
- The class also provide hooks to add test-specific options. Here is
- an example:
-
- class BodyChildElementMeasurement(PageTest):
- def AddCommandLineArgs(parser):
- parser.add_option('--element', action='store', default='body')
-
- def ValidateAndMeasurePage(self, page, tab, results):
- body_child_count = tab.EvaluateJavaScript(
- 'document.querySelector('%s').children.length')
- results.AddValue(scalar.ScalarValue(
- page, 'children', 'count', child_count))
-
Args:
action_name_to_run: This is the method name in telemetry.page.Page
subclasses to run.
@@ -63,8 +49,6 @@ class PageTest(command_line.Command):
will fail.
"""
- options = {}
-
def __init__(self,
action_name_to_run='',
needs_browser_restart_after_each_page=False,
@@ -98,10 +82,6 @@ class PageTest(command_line.Command):
# _exit_requested is set to true when the test requests an early exit.
self._exit_requested = False
- @classmethod
- def SetArgumentDefaults(cls, parser):
- parser.set_defaults(**cls.options)
-
@property
def discard_first_result(self):
"""When set to True, the first run of the test is discarded. This is
@@ -138,11 +118,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?

Powered by Google App Engine
This is Rietveld 408576698