| Index: tools/perf/page_sets/key_mobile_sites_cycler.py
|
| diff --git a/tools/perf/page_sets/key_mobile_sites_repaint.py b/tools/perf/page_sets/key_mobile_sites_cycler.py
|
| similarity index 70%
|
| copy from tools/perf/page_sets/key_mobile_sites_repaint.py
|
| copy to tools/perf/page_sets/key_mobile_sites_cycler.py
|
| index aace81a96d0ac43c44886bc6ca5388c2673e8115..8a30ea5db924a893d1c9789a04ac92778785a897 100644
|
| --- a/tools/perf/page_sets/key_mobile_sites_repaint.py
|
| +++ b/tools/perf/page_sets/key_mobile_sites_cycler.py
|
| @@ -1,4 +1,4 @@
|
| -# Copyright 2014 The Chromium Authors. All rights reserved.
|
| +# Copyright 2015 The Chromium Authors. All rights reserved.
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
| from telemetry.page import page as page_module
|
| @@ -7,39 +7,26 @@ from telemetry.page import page_set as page_set_module
|
| from page_sets import key_mobile_sites_pages
|
|
|
|
|
| -def _RepaintContinously(action_runner):
|
| - action_runner.RepaintContinuously(seconds=5)
|
| +class KeyMobileSitesCyclerPage(page_module.Page):
|
|
|
| -
|
| -def _CreatePageClassWithRepaintInteractions(page_cls):
|
| - class DerivedRepaintPage(page_cls): # pylint: disable=W0232
|
| -
|
| - def RunPageInteractions(self, action_runner):
|
| - _RepaintContinously(action_runner)
|
| - return DerivedRepaintPage
|
| -
|
| -
|
| -class KeyMobileSitesRepaintPage(page_module.Page):
|
| -
|
| - def __init__(self, url, page_set, name='', labels=None):
|
| - super(KeyMobileSitesRepaintPage, self).__init__(
|
| + def __init__(self, url, page_set, name='', labels=None,
|
| + action_on_load_complete=False):
|
| + super(KeyMobileSitesCyclerPage, self).__init__(
|
| url=url, page_set=page_set, name=name,
|
| credentials_path='data/credentials.json', labels=labels)
|
| self.user_agent_type = 'mobile'
|
| - self.archive_data_file = 'data/key_mobile_sites_repaint.json'
|
| -
|
| - def RunPageInteractions(self, action_runner):
|
| - _RepaintContinously(action_runner)
|
| + self.archive_data_file = 'data/key_mobile_sites.json'
|
| + self.action_on_load_complete = action_on_load_complete
|
|
|
|
|
| -class KeyMobileSitesRepaintPageSet(page_set_module.PageSet):
|
| +class KeyMobileSitesCyclerPageSet(page_set_module.PageSet):
|
|
|
| - """ Key mobile sites with repaint interactions. """
|
| + """ Key mobile sites with smooth interactions. """
|
|
|
| def __init__(self):
|
| - super(KeyMobileSitesRepaintPageSet, self).__init__(
|
| + super(KeyMobileSitesCyclerPageSet, self).__init__(
|
| user_agent_type='mobile',
|
| - archive_data_file='data/key_mobile_sites_repaint.json',
|
| + archive_data_file='data/key_mobile_sites_cycler.json',
|
| bucket=page_set_module.PARTNER_BUCKET)
|
|
|
|
|
| @@ -52,82 +39,89 @@ class KeyMobileSitesRepaintPageSet(page_set_module.PageSet):
|
| key_mobile_sites_pages.YoutubeMobilePage,
|
| key_mobile_sites_pages.LinkedInPage,
|
| key_mobile_sites_pages.YahooAnswersPage,
|
| - key_mobile_sites_pages.GmailPage,
|
| key_mobile_sites_pages.GoogleNewsMobilePage,
|
| key_mobile_sites_pages.GoogleNewsMobile2Page,
|
| key_mobile_sites_pages.AmazonNicolasCagePage,
|
| - # Page behaves non-deterministically, replaced with test version for now.
|
| - # key_mobile_sites_pages.GroupClonedPage,
|
| -
|
| - # mean_input_event_latency cannot be tracked correctly for
|
| - # GroupClonedListImagesPage. See crbug.com/409086.
|
| - # key_mobile_sites_pages.GroupClonedListImagesPage,
|
| ]
|
| for page_class in predefined_page_classes:
|
| - self.AddUserStory(
|
| - _CreatePageClassWithRepaintInteractions(page_class)(self))
|
| + self.AddUserStory(page_class(self))
|
| +
|
| + # Add pages with custom page interaction logic.
|
| +
|
| + # Page behaves non-deterministically, replaced with test version for now.
|
| + # self.AddUserStory(GroupClonedPage(self))
|
| + # mean_input_event_latency cannot be tracked correctly for
|
| + # GroupClonedListImagesPage.
|
| + # See crbug.com/409086.
|
| + # self.AddUserStory(GroupClonedListImagesPage(self))
|
|
|
| # Add pages with custom labels.
|
|
|
| # Why: Top news site.
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://nytimes.com/', page_set=self, labels=['fastpath']))
|
|
|
| # Why: Image-heavy site.
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://cuteoverload.com', page_set=self, labels=['fastpath']))
|
|
|
| # Why: #11 (Alexa global), google property; some blogger layouts
|
| # have infinite scroll but more interesting.
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://googlewebmastercentral.blogspot.com/',
|
| page_set=self, name='Blogger'))
|
|
|
| # Why: #18 (Alexa global), Picked an interesting post """
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| # pylint: disable=line-too-long
|
| url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/',
|
| page_set=self,
|
| name='Wordpress'))
|
|
|
| - # Why: #6 (Alexa) most visited worldwide, picked an interesting page
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + # Why: #6 (Alexa) most visited worldwide, picked an interesting page
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://en.wikipedia.org/wiki/Wikipedia',
|
| page_set=self,
|
| name='Wikipedia (1 tab)'))
|
|
|
| + # Why: Wikipedia page with a delayed scroll start
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| + url='http://en.wikipedia.org/wiki/Wikipedia',
|
| + page_set=self,
|
| + name='Wikipedia (1 tab) - delayed scroll start',
|
| + action_on_load_complete=True))
|
|
|
| # Why: #8 (Alexa global), picked an interesting page
|
| # Forbidden (Rate Limit Exceeded)
|
| - # self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + # self.AddUserStory(KeyMobileSitesCyclerPage(
|
| # url='http://twitter.com/katyperry', page_set=self, name='Twitter'))
|
|
|
| # Why: #37 (Alexa global) """
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://pinterest.com',
|
| page_set=self,
|
| name='Pinterest'))
|
|
|
| # Why: #1 sports.
|
| # Fails often; crbug.com/249722'
|
| - # self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + # self.AddUserStory(KeyMobileSitesCyclerPage(
|
| # url='http://espn.go.com', page_set=self, name='ESPN'))
|
| # Why: crbug.com/231413
|
| # Doesn't scroll; crbug.com/249736
|
| - # self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + # self.AddUserStory(KeyMobileSitesCyclerPage(
|
| # url='http://forecast.io', page_set=self))
|
| # Why: crbug.com/169827
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://slashdot.org/', page_set=self, labels=['fastpath']))
|
|
|
| # Why: #5 Alexa news """
|
|
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://www.reddit.com/r/programming/comments/1g96ve',
|
| page_set=self, labels=['fastpath']))
|
|
|
| # Why: Problematic use of fixed position elements """
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(
|
| url='http://www.boingboing.net', page_set=self, labels=['fastpath']))
|
|
|
| # Add simple pages with no custom navigation logic or labels.
|
| @@ -182,4 +176,4 @@ class KeyMobileSitesRepaintPageSet(page_set_module.PageSet):
|
| ]
|
|
|
| for url in urls_list:
|
| - self.AddUserStory(KeyMobileSitesRepaintPage(url, self))
|
| + self.AddUserStory(KeyMobileSitesCyclerPage(url, self))
|
|
|