summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorchrishenry <chrishenry@google.com>2014-12-05 15:43:23 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-05 23:44:22 +0000
commit5a1a8edb923692c2075810955c867a4f941fb78e (patch)
tree4c768b5cbc0ae0c0e7faed7d74bfd8dc641a86d8 /tools
parent12349f0e5c13def99e4c4cf9fc6b2d7d73eb695f (diff)
downloadchromium_src-5a1a8edb923692c2075810955c867a4f941fb78e.zip
chromium_src-5a1a8edb923692c2075810955c867a4f941fb78e.tar.gz
chromium_src-5a1a8edb923692c2075810955c867a4f941fb78e.tar.bz2
Remove startup_url from PageSet, we can now only specify startup_url on a Page.
Also make startup_url immutable. BUG=439512 Review URL: https://codereview.chromium.org/782033002 Cr-Commit-Position: refs/heads/master@{#307116}
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/measurements/startup.py2
-rw-r--r--tools/perf/page_sets/startup_pages.py4
-rw-r--r--tools/telemetry/telemetry/page/__init__.py8
-rw-r--r--tools/telemetry/telemetry/page/page_set.py6
-rw-r--r--tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py8
5 files changed, 15 insertions, 13 deletions
diff --git a/tools/perf/measurements/startup.py b/tools/perf/measurements/startup.py
index bc0617d..8b57a48 100644
--- a/tools/perf/measurements/startup.py
+++ b/tools/perf/measurements/startup.py
@@ -46,7 +46,7 @@ class StartWithUrl(Startup):
has already cached much of Chromium's content. For warm tests, you should
repeat the page set to ensure it's cached.
- The startup URL is taken from the page set's startup_url. This
+ The startup URL is taken from the page's startup_url. This
allows the testing of multiple different URLs in a single benchmark.
"""
diff --git a/tools/perf/page_sets/startup_pages.py b/tools/perf/page_sets/startup_pages.py
index 2adb7ca..0fbfacb 100644
--- a/tools/perf/page_sets/startup_pages.py
+++ b/tools/perf/page_sets/startup_pages.py
@@ -8,9 +8,9 @@ from telemetry.page import page_set as page_set_module
class StartedPage(page_module.Page):
def __init__(self, url, startup_url, page_set):
- super(StartedPage, self).__init__(url=url, page_set=page_set)
+ super(StartedPage, self).__init__(
+ url=url, page_set=page_set, startup_url=startup_url)
self.archive_data_file = 'data/startup_pages.json'
- self.startup_url = startup_url
def RunNavigateSteps(self, action_runner):
action_runner.Wait(10)
diff --git a/tools/telemetry/telemetry/page/__init__.py b/tools/telemetry/telemetry/page/__init__.py
index 0584986..ab95c21 100644
--- a/tools/telemetry/telemetry/page/__init__.py
+++ b/tools/telemetry/telemetry/page/__init__.py
@@ -24,7 +24,7 @@ def _UpdateCredentials(credentials_path):
class Page(user_story.UserStory):
def __init__(self, url, page_set=None, base_dir=None, name='',
- credentials_path=None, labels=None):
+ credentials_path=None, labels=None, startup_url=''):
super(Page, self).__init__(shared_page_state.SharedPageState, name, labels)
self._url = url
self._page_set = page_set
@@ -44,7 +44,7 @@ class Page(user_story.UserStory):
# These attributes can be set dynamically by the page.
self.synthetic_delays = dict()
- self.startup_url = page_set.startup_url if page_set else ''
+ self._startup_url = startup_url
self.credentials = None
self.skip_waits = False
self.script_to_evaluate_on_commit = None
@@ -54,6 +54,10 @@ class Page(user_story.UserStory):
def credentials_path(self):
return self._credentials_path
+ @property
+ def startup_url(self):
+ return self._startup_url
+
def _SchemeErrorCheck(self):
if not self._scheme:
raise ValueError('Must prepend the URL with scheme (e.g. file://)')
diff --git a/tools/telemetry/telemetry/page/page_set.py b/tools/telemetry/telemetry/page/page_set.py
index 682f069..3246ff6 100644
--- a/tools/telemetry/telemetry/page/page_set.py
+++ b/tools/telemetry/telemetry/page/page_set.py
@@ -22,8 +22,8 @@ class PageSetError(Exception):
class PageSet(user_story_set.UserStorySet):
def __init__(self, file_path=None, archive_data_file='', user_agent_type=None,
- make_javascript_deterministic=True, startup_url='',
- serving_dirs=None, bucket=None):
+ make_javascript_deterministic=True, serving_dirs=None,
+ bucket=None):
super(PageSet, self).__init__()
# The default value of file_path is location of the file that define this
# page set instance's class.
@@ -39,8 +39,6 @@ class PageSet(user_story_set.UserStorySet):
self.user_agent_type = user_agent_type
self.make_javascript_deterministic = make_javascript_deterministic
self._wpr_archive_info = None
- self.startup_url = startup_url
- self.user_stories = []
# Convert any relative serving_dirs to absolute paths.
self._serving_dirs = set(os.path.realpath(os.path.join(self.base_dir, d))
for d in serving_dirs or [])
diff --git a/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py b/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
index e2f0a06..c7e353c 100644
--- a/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
+++ b/tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py
@@ -104,10 +104,6 @@ class PageSetSmokeTest(unittest.TestCase):
isinstance(page_set.make_javascript_deterministic, bool),
msg='page_set\'s make_javascript_deterministic must have type bool')
- self.assertTrue(
- isinstance(page_set.startup_url, str),
- msg='page_set\'s startup_url must have type string')
-
def CheckAttributesOfPageBasicAttributes(self, page):
self.assertTrue(not hasattr(page, 'disabled'))
self.assertTrue(
@@ -123,6 +119,10 @@ class PageSetSmokeTest(unittest.TestCase):
self.assertTrue(
isinstance(page.labels, set),
msg='page %s \'s labels field must have type set' % page.display_name)
+ self.assertTrue(
+ isinstance(page.startup_url, str),
+ msg=('page %s \'s startup_url field must have type string'
+ % page.display_name))
for l in page.labels:
self.assertTrue(
isinstance(l, str),