| Index: tools/perf/page_sets/top_7_stress.py
|
| diff --git a/tools/perf/page_sets/top_25.py b/tools/perf/page_sets/top_7_stress.py
|
| similarity index 60%
|
| copy from tools/perf/page_sets/top_25.py
|
| copy to tools/perf/page_sets/top_7_stress.py
|
| index 4e66b639804200f0dba1bcbcf31a2c264f9aac24..ae18deb237666ac08795c3b36533001b23d660a8 100644
|
| --- a/tools/perf/page_sets/top_25.py
|
| +++ b/tools/perf/page_sets/top_7_stress.py
|
| @@ -14,26 +14,20 @@ def _WaitForLocationChange(action_runner, old_href):
|
| 'document.location.href != "%s"' % old_href)
|
|
|
|
|
| -class Top25Page(page_module.Page):
|
| +class Top7StressPage(page_module.Page):
|
|
|
| def __init__(self, url, page_set, name=''):
|
| - super(Top25Page, self).__init__(
|
| + super(Top7StressPage, self).__init__(
|
| url=url, page_set=page_set, name=name,
|
| - credentials_path='data/credentials.json')
|
| + credentials_path = 'data/credentials.json')
|
| self.user_agent_type = 'desktop'
|
| self.archive_data_file = 'data/top_25.json'
|
|
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage()
|
| - interaction.End()
|
| + def RunPageInteractions(self, action_runner):
|
| + raise NotImplementedError()
|
|
|
| - def RunRepaint(self, action_runner):
|
| - action_runner.RepaintContinuously(seconds=5)
|
|
|
| -
|
| -class GoogleWebSearchPage(Top25Page):
|
| +class GoogleWebSearchPage(Top7StressPage):
|
|
|
| """ Why: top google property; a google tab is often open """
|
|
|
| @@ -46,7 +40,7 @@ class GoogleWebSearchPage(Top25Page):
|
| action_runner.NavigateToPage(self)
|
| action_runner.WaitForElement(text='Next')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| interaction = action_runner.BeginGestureInteraction(
|
| 'ScrollAction', is_smooth=True)
|
| action_runner.ScrollPage()
|
| @@ -105,7 +99,7 @@ class GoogleWebSearchPage(Top25Page):
|
| action_runner.WaitForElement(text='Images')
|
|
|
|
|
| -class GmailPage(Top25Page):
|
| +class GmailPage(Top7StressPage):
|
|
|
| """ Why: productivity, top google properties """
|
|
|
| @@ -122,7 +116,7 @@ class GmailPage(Top25Page):
|
| 'window.gmonkey !== undefined &&'
|
| 'document.getElementById("gb") !== null')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| old_href = _GetCurrentLocation(action_runner)
|
| action_runner.ClickElement(
|
| 'a[href="https://mail.google.com/mail/u/0/?shva=1#starred"]')
|
| @@ -132,21 +126,8 @@ class GmailPage(Top25Page):
|
| 'a[href="https://mail.google.com/mail/u/0/?shva=1#inbox"]')
|
| _WaitForLocationChange(action_runner, old_href)
|
|
|
| - def RunSmoothness(self, action_runner):
|
| - action_runner.ExecuteJavaScript('''
|
| - gmonkey.load('2.0', function(api) {
|
| - window.__scrollableElementForTelemetry = api.getScrollableElement();
|
| - });''')
|
| - action_runner.WaitForJavaScriptCondition(
|
| - 'window.__scrollableElementForTelemetry != null')
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollElement(
|
| - element_function='window.__scrollableElementForTelemetry')
|
| - interaction.End()
|
| -
|
|
|
| -class GoogleCalendarPage(Top25Page):
|
| +class GoogleCalendarPage(Top7StressPage):
|
|
|
| """ Why: productivity, top google properties """
|
|
|
| @@ -170,7 +151,7 @@ class GoogleCalendarPage(Top25Page):
|
| })();''')
|
| action_runner.Wait(1)
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| action_runner.ClickElement('div[class~="navForward"]')
|
| action_runner.Wait(2)
|
| action_runner.WaitForElement('div[class~="navForward"]')
|
| @@ -196,52 +177,8 @@ class GoogleCalendarPage(Top25Page):
|
| action_runner.Wait(2)
|
| action_runner.WaitForElement('div[class~="navBack"]')
|
|
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollElement(selector='#scrolltimedeventswk')
|
| - interaction.End()
|
| -
|
| -
|
| -class GoogleImageSearchPage(Top25Page):
|
| -
|
| - """ Why: tough image case; top google properties """
|
| -
|
| - def __init__(self, page_set):
|
| - super(GoogleImageSearchPage, self).__init__(
|
| - url='https://www.google.com/search?q=cats&tbm=isch',
|
| - page_set=page_set)
|
| -
|
| - self.credentials = 'google'
|
| -
|
| -
|
| -class GoogleDocPage(Top25Page):
|
| -
|
| - """ Why: productivity, top google properties; Sample doc in the link """
|
| -
|
| - def __init__(self, page_set):
|
| - super(GoogleDocPage, self).__init__(
|
| - # pylint: disable=C0301
|
| - url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfTpAPUSX3_s4/view',
|
| - page_set=page_set,
|
| - name='Docs (1 open document tab)')
|
| -
|
| - self.credentials = 'google'
|
| -
|
| - def RunNavigateSteps(self, action_runner):
|
| - action_runner.NavigateToPage(self)
|
| - action_runner.Wait(2)
|
| - action_runner.WaitForJavaScriptCondition(
|
| - 'document.getElementsByClassName("kix-appview-editor").length')
|
| -
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollElement(selector='.kix-appview-editor')
|
| - interaction.End()
|
|
|
| -
|
| -class GooglePlusPage(Top25Page):
|
| +class GooglePlusPage(Top7StressPage):
|
|
|
| """ Why: social; top google property; Public profile; infinite scrolls """
|
|
|
| @@ -256,7 +193,7 @@ class GooglePlusPage(Top25Page):
|
| action_runner.NavigateToPage(self)
|
| action_runner.WaitForElement(text='Home')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| action_runner.ClickElement(text='Home')
|
| action_runner.Wait(2)
|
| action_runner.WaitForElement(text='Profile')
|
| @@ -273,30 +210,8 @@ class GooglePlusPage(Top25Page):
|
| action_runner.Wait(2)
|
| action_runner.WaitForElement(text='Home')
|
|
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage()
|
| - interaction.End()
|
| -
|
| -
|
| -class YoutubePage(Top25Page):
|
| -
|
| - """ Why: #3 (Alexa global) """
|
|
|
| - def __init__(self, page_set):
|
| - super(YoutubePage, self).__init__(
|
| - url='http://www.youtube.com',
|
| - page_set=page_set)
|
| -
|
| - self.credentials = 'google'
|
| -
|
| - def RunNavigateSteps(self, action_runner):
|
| - action_runner.NavigateToPage(self)
|
| - action_runner.Wait(2)
|
| -
|
| -
|
| -class BlogspotPage(Top25Page):
|
| +class BlogspotPage(Top7StressPage):
|
|
|
| """ Why: #11 (Alexa global), google property; some blogger layouts have
|
| infinite scroll but more interesting """
|
| @@ -311,7 +226,7 @@ class BlogspotPage(Top25Page):
|
| action_runner.NavigateToPage(self)
|
| action_runner.WaitForElement(text='accessibility')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| action_runner.ClickElement(text='accessibility')
|
| action_runner.WaitForNavigate()
|
| interaction = action_runner.BeginGestureInteraction(
|
| @@ -334,7 +249,7 @@ class BlogspotPage(Top25Page):
|
| action_runner.WaitForNavigate()
|
|
|
|
|
| -class WordpressPage(Top25Page):
|
| +class WordpressPage(Top7StressPage):
|
|
|
| """ Why: #18 (Alexa global), Picked an interesting post """
|
|
|
| @@ -351,7 +266,7 @@ class WordpressPage(Top25Page):
|
| # pylint: disable=C0301
|
| 'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/"]')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| interaction = action_runner.BeginGestureInteraction(
|
| 'ScrollAction', is_smooth=True)
|
| action_runner.ScrollPage()
|
| @@ -378,7 +293,7 @@ class WordpressPage(Top25Page):
|
| interaction.End()
|
|
|
|
|
| -class FacebookPage(Top25Page):
|
| +class FacebookPage(Top7StressPage):
|
|
|
| """ Why: top social,Public profile """
|
|
|
| @@ -393,7 +308,7 @@ class FacebookPage(Top25Page):
|
| action_runner.NavigateToPage(self)
|
| action_runner.WaitForElement(text='About')
|
|
|
| - def RunStressMemory(self, action_runner):
|
| + def RunPageInteractions(self, action_runner):
|
| action_runner.ClickElement(text='About')
|
| action_runner.WaitForNavigate()
|
| action_runner.ClickElement(text='The Audacity of Hope')
|
| @@ -407,122 +322,13 @@ class FacebookPage(Top25Page):
|
| action_runner.ClickElement(text='Home')
|
| action_runner.WaitForNavigate()
|
|
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage()
|
| - interaction.End()
|
| -
|
| -
|
| -class LinkedinPage(Top25Page):
|
| -
|
| - """ Why: #12 (Alexa global),Public profile """
|
| -
|
| - def __init__(self, page_set):
|
| - super(LinkedinPage, self).__init__(
|
| - url='http://www.linkedin.com/in/linustorvalds',
|
| - page_set=page_set,
|
| - name='LinkedIn')
|
| -
|
| -
|
| -class WikipediaPage(Top25Page):
|
| -
|
| - """ Why: #6 (Alexa) most visited worldwide,Picked an interesting page """
|
| -
|
| - def __init__(self, page_set):
|
| - super(WikipediaPage, self).__init__(
|
| - url='http://en.wikipedia.org/wiki/Wikipedia',
|
| - page_set=page_set,
|
| - name='Wikipedia (1 tab)')
|
| -
|
| -
|
| -class TwitterPage(Top25Page):
|
| -
|
| - """ Why: #8 (Alexa global),Picked an interesting page """
|
| -
|
| - def __init__(self, page_set):
|
| - super(TwitterPage, self).__init__(
|
| - url='https://twitter.com/katyperry',
|
| - page_set=page_set,
|
| - name='Twitter')
|
| -
|
| - def RunNavigateSteps(self, action_runner):
|
| - action_runner.NavigateToPage(self)
|
| - action_runner.Wait(2)
|
| -
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage()
|
| - interaction.End()
|
| -
|
| -
|
| -class PinterestPage(Top25Page):
|
| -
|
| - """ Why: #37 (Alexa global) """
|
| -
|
| - def __init__(self, page_set):
|
| - super(PinterestPage, self).__init__(
|
| - url='http://pinterest.com',
|
| - page_set=page_set,
|
| - name='Pinterest')
|
| -
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage()
|
| - interaction.End()
|
| -
|
| -
|
| -class ESPNPage(Top25Page):
|
| -
|
| - """ Why: #1 sports """
|
| -
|
| - def __init__(self, page_set):
|
| - super(ESPNPage, self).__init__(
|
| - url='http://espn.go.com',
|
| - page_set=page_set,
|
| - name='ESPN')
|
| -
|
| - def RunSmoothness(self, action_runner):
|
| - interaction = action_runner.BeginGestureInteraction(
|
| - 'ScrollAction', is_smooth=True)
|
| - action_runner.ScrollPage(left_start_ratio=0.1)
|
| - interaction.End()
|
| -
|
| -
|
| -class WeatherDotComPage(Top25Page):
|
| -
|
| - """ Why: #7 (Alexa news); #27 total time spent,Picked interesting page """
|
| -
|
| - def __init__(self, page_set):
|
| - super(WeatherDotComPage, self).__init__(
|
| - # pylint: disable=C0301
|
| - url='http://www.weather.com/weather/right-now/Mountain+View+CA+94043',
|
| - page_set=page_set,
|
| - name='Weather.com')
|
| -
|
| -
|
| -class YahooGamesPage(Top25Page):
|
| -
|
| - """ Why: #1 games according to Alexa (with actual games in it) """
|
| -
|
| - def __init__(self, page_set):
|
| - super(YahooGamesPage, self).__init__(
|
| - url='http://games.yahoo.com',
|
| - page_set=page_set)
|
| -
|
| - def RunNavigateSteps(self, action_runner):
|
| - action_runner.NavigateToPage(self)
|
| - action_runner.Wait(2)
|
| -
|
|
|
| -class Top25PageSet(page_set_module.PageSet):
|
| +class Top7StressPageSet(page_set_module.PageSet):
|
|
|
| - """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """
|
| + """ Pages hand-picked for stress testing. """
|
|
|
| def __init__(self):
|
| - super(Top25PageSet, self).__init__(
|
| + super(Top7StressPageSet, self).__init__(
|
| user_agent_type='desktop',
|
| archive_data_file='data/top_25.json',
|
| bucket=page_set_module.PARTNER_BUCKET)
|
| @@ -530,40 +336,7 @@ class Top25PageSet(page_set_module.PageSet):
|
| self.AddPage(GoogleWebSearchPage(self))
|
| self.AddPage(GmailPage(self))
|
| self.AddPage(GoogleCalendarPage(self))
|
| - self.AddPage(GoogleImageSearchPage(self))
|
| - self.AddPage(GoogleDocPage(self))
|
| self.AddPage(GooglePlusPage(self))
|
| - self.AddPage(YoutubePage(self))
|
| self.AddPage(BlogspotPage(self))
|
| self.AddPage(WordpressPage(self))
|
| self.AddPage(FacebookPage(self))
|
| - self.AddPage(LinkedinPage(self))
|
| - self.AddPage(WikipediaPage(self))
|
| - self.AddPage(TwitterPage(self))
|
| - self.AddPage(PinterestPage(self))
|
| - self.AddPage(ESPNPage(self))
|
| - self.AddPage(WeatherDotComPage(self))
|
| - self.AddPage(YahooGamesPage(self))
|
| -
|
| - other_urls = [
|
| - # Why: #1 news worldwide (Alexa global)
|
| - 'http://news.yahoo.com',
|
| - # Why: #2 news worldwide
|
| - 'http://www.cnn.com',
|
| - # Why: #1 world commerce website by visits; #3 commerce in the US by time
|
| - # spent
|
| - 'http://www.amazon.com',
|
| - # Why: #1 commerce website by time spent by users in US
|
| - 'http://www.ebay.com',
|
| - # Why: #1 Alexa recreation
|
| - 'http://booking.com',
|
| - # Why: #1 Alexa reference
|
| - 'http://answers.yahoo.com',
|
| - # Why: #1 Alexa sports
|
| - 'http://sports.yahoo.com/',
|
| - # Why: top tech blog
|
| - 'http://techcrunch.com'
|
| - ]
|
| -
|
| - for url in other_urls:
|
| - self.AddPage(Top25Page(url, self))
|
|
|