| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class SimpleScrollPage(page_module.Page): | 8 class SimpleScrollPage(page_module.Page): |
| 9 def __init__(self, url, page_set, credentials='', name=''): | 9 def __init__(self, url, page_set, credentials='', name=''): |
| 10 super(SimpleScrollPage, self).__init__(url, page_set=page_set, name=name) | 10 super(SimpleScrollPage, self).__init__( |
| 11 url, page_set=page_set, name=name, |
| 12 credentials_path='data/credentials.json') |
| 11 self.credentials = credentials | 13 self.credentials = credentials |
| 12 | 14 |
| 13 def RunSmoothness(self, action_runner): | 15 def RunSmoothness(self, action_runner): |
| 14 interaction = action_runner.BeginGestureInteraction( | 16 interaction = action_runner.BeginGestureInteraction( |
| 15 'ScrollAction', is_smooth=True) | 17 'ScrollAction', is_smooth=True) |
| 16 action_runner.ScrollPage() | 18 action_runner.ScrollPage() |
| 17 interaction.End() | 19 interaction.End() |
| 18 | 20 |
| 19 class Google(SimpleScrollPage): | 21 class Google(SimpleScrollPage): |
| 20 def __init__(self, page_set): | 22 def __init__(self, page_set): |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 super(Facebook, self).RunNavigateSteps(action_runner) | 85 super(Facebook, self).RunNavigateSteps(action_runner) |
| 84 action_runner.WaitForElement(text='About') | 86 action_runner.WaitForElement(text='About') |
| 85 | 87 |
| 86 | 88 |
| 87 class Top10PageSet(page_set_module.PageSet): | 89 class Top10PageSet(page_set_module.PageSet): |
| 88 """10 Pages chosen from Alexa top sites""" | 90 """10 Pages chosen from Alexa top sites""" |
| 89 | 91 |
| 90 def __init__(self): | 92 def __init__(self): |
| 91 super(Top10PageSet, self).__init__( | 93 super(Top10PageSet, self).__init__( |
| 92 archive_data_file='data/top_10.json', | 94 archive_data_file='data/top_10.json', |
| 93 credentials_path='data/credentials.json', | |
| 94 user_agent_type='desktop', | 95 user_agent_type='desktop', |
| 95 bucket=page_set_module.PARTNER_BUCKET) | 96 bucket=page_set_module.PARTNER_BUCKET) |
| 96 | 97 |
| 97 # top google property; a google tab is often open | 98 # top google property; a google tab is often open |
| 98 self.AddPage(Google(self)) | 99 self.AddPage(Google(self)) |
| 99 | 100 |
| 100 # productivity, top google properties | 101 # productivity, top google properties |
| 101 # TODO(dominikg): fix crbug.com/386152 | 102 # TODO(dominikg): fix crbug.com/386152 |
| 102 #self.AddPage(Gmail(self)) | 103 #self.AddPage(Gmail(self)) |
| 103 | 104 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 118 self.AddPage(SimpleScrollPage('http://www.amazon.com', self)) | 119 self.AddPage(SimpleScrollPage('http://www.amazon.com', self)) |
| 119 | 120 |
| 120 # #4 Alexa | 121 # #4 Alexa |
| 121 self.AddPage(SimpleScrollPage('http://www.yahoo.com/', self)) | 122 self.AddPage(SimpleScrollPage('http://www.yahoo.com/', self)) |
| 122 | 123 |
| 123 # #16 Alexa | 124 # #16 Alexa |
| 124 self.AddPage(SimpleScrollPage('http://www.bing.com/', self)) | 125 self.AddPage(SimpleScrollPage('http://www.bing.com/', self)) |
| 125 | 126 |
| 126 # #20 Alexa | 127 # #20 Alexa |
| 127 self.AddPage(SimpleScrollPage('http://www.ask.com/', self)) | 128 self.AddPage(SimpleScrollPage('http://www.ask.com/', self)) |
| OLD | NEW |