| 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 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
| 5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
| 6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
| 7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
| 8 | 8 |
| 9 | 9 |
| 10 class ToughCompositorPage(page_module.Page): | 10 class ToughCompositorPage(page_module.Page): |
| 11 | 11 |
| 12 def __init__(self, url, page_set): | 12 def __init__(self, url, page_set): |
| 13 super(ToughCompositorPage, self).__init__(url=url, page_set=page_set) | 13 super(ToughCompositorPage, self).__init__(url=url, page_set=page_set) |
| 14 self.credentials_path = 'data/credentials.json' | 14 self.credentials_path = 'data/credentials.json' |
| 15 self.user_agent_type = 'mobile' | 15 self.user_agent_type = 'mobile' |
| 16 self.archive_data_file = 'data/tough_compositor_cases.json' | 16 self.archive_data_file = 'data/tough_compositor_cases.json' |
| 17 | 17 |
| 18 def RunNavigateSteps(self, action_runner): | 18 def RunNavigateSteps(self, action_runner): |
| 19 action_runner.NavigateToPage(self) | 19 action_runner.NavigateToPage(self) |
| 20 # TODO(epenner): Remove this wait (http://crbug.com/366933) | 20 # TODO(epenner): Remove this wait (http://crbug.com/366933) |
| 21 action_runner.RunAction(WaitAction({'seconds': 5})) | 21 action_runner.Wait(5) |
| 22 | 22 |
| 23 class ToughCompositorScrollPage(ToughCompositorPage): | 23 class ToughCompositorScrollPage(ToughCompositorPage): |
| 24 | 24 |
| 25 def __init__(self, url, page_set): | 25 def __init__(self, url, page_set): |
| 26 super(ToughCompositorScrollPage, self).__init__(url=url, page_set=page_set) | 26 super(ToughCompositorScrollPage, self).__init__(url=url, page_set=page_set) |
| 27 | 27 |
| 28 def RunSmoothness(self, action_runner): | 28 def RunSmoothness(self, action_runner): |
| 29 # Make the scroll longer to reduce noise. | 29 # Make the scroll longer to reduce noise. |
| 30 scroll_down = ScrollAction() | 30 scroll_down = ScrollAction() |
| 31 scroll_down.direction = "down" | 31 scroll_down.direction = "down" |
| 32 scroll_down.speed = 300 | 32 scroll_down.speed = 300 |
| 33 action_runner.RunAction(scroll_down) | 33 action_runner.RunAction(scroll_down) |
| 34 | 34 |
| 35 class ToughCompositorWaitPage(ToughCompositorPage): | 35 class ToughCompositorWaitPage(ToughCompositorPage): |
| 36 | 36 |
| 37 def __init__(self, url, page_set): | 37 def __init__(self, url, page_set): |
| 38 super(ToughCompositorWaitPage, self).__init__(url=url, page_set=page_set) | 38 super(ToughCompositorWaitPage, self).__init__(url=url, page_set=page_set) |
| 39 | 39 |
| 40 def RunSmoothness(self, action_runner): | 40 def RunSmoothness(self, action_runner): |
| 41 # We scroll back and forth a few times to reduce noise in the tests. | 41 # We scroll back and forth a few times to reduce noise in the tests. |
| 42 action_runner.RunAction(WaitAction({'seconds': 8})) | 42 action_runner.Wait(8) |
| 43 | 43 |
| 44 | 44 |
| 45 class ToughCompositorCasesPageSet(page_set_module.PageSet): | 45 class ToughCompositorCasesPageSet(page_set_module.PageSet): |
| 46 | 46 |
| 47 """ Touch compositor sites """ | 47 """ Touch compositor sites """ |
| 48 | 48 |
| 49 def __init__(self): | 49 def __init__(self): |
| 50 super(ToughCompositorCasesPageSet, self).__init__( | 50 super(ToughCompositorCasesPageSet, self).__init__( |
| 51 credentials_path='data/credentials.json', | 51 credentials_path='data/credentials.json', |
| 52 user_agent_type='mobile', | 52 user_agent_type='mobile', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 'http://jsbin.com/giqafofe/1/quiet?JS_POSTER_CIRCLE', | 70 'http://jsbin.com/giqafofe/1/quiet?JS_POSTER_CIRCLE', |
| 71 # Why: JS invalidation does lots of uploads """ | 71 # Why: JS invalidation does lots of uploads """ |
| 72 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION', | 72 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION', |
| 73 ] | 73 ] |
| 74 | 74 |
| 75 for url in scroll_urls_list: | 75 for url in scroll_urls_list: |
| 76 self.AddPage(ToughCompositorScrollPage(url, self)) | 76 self.AddPage(ToughCompositorScrollPage(url, self)) |
| 77 | 77 |
| 78 for url in wait_urls_list: | 78 for url in wait_urls_list: |
| 79 self.AddPage(ToughCompositorWaitPage(url, self)) | 79 self.AddPage(ToughCompositorWaitPage(url, self)) |
| OLD | NEW |