| 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 ToughCompositorPage(page_module.Page): | 8 class ToughCompositorPage(page_module.Page): |
| 9 | 9 |
| 10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
| 11 super(ToughCompositorPage, self).__init__( | 11 super(ToughCompositorPage, self).__init__( |
| 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') | 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') |
| 13 self.user_agent_type = 'mobile' | 13 self.user_agent_type = 'mobile' |
| 14 self.archive_data_file = 'data/tough_compositor_cases.json' | 14 self.archive_data_file = 'data/tough_compositor_cases.json' |
| 15 | 15 |
| 16 def RunNavigateSteps(self, action_runner): | 16 def RunNavigateSteps(self, action_runner): |
| 17 super(ToughCompositorPage, self).RunNavigateSteps(action_runner) | 17 super(ToughCompositorPage, self).RunNavigateSteps(action_runner) |
| 18 # TODO(epenner): Remove this wait (http://crbug.com/366933) | 18 # TODO(epenner): Remove this wait (http://crbug.com/366933) |
| 19 action_runner.Wait(5) | 19 action_runner.Wait(5) |
| 20 | 20 |
| 21 class ToughCompositorScrollPage(ToughCompositorPage): | 21 class ToughCompositorScrollPage(ToughCompositorPage): |
| 22 | 22 |
| 23 def __init__(self, url, page_set): | 23 def __init__(self, url, page_set): |
| 24 super(ToughCompositorScrollPage, self).__init__(url=url, page_set=page_set) | 24 super(ToughCompositorScrollPage, self).__init__(url=url, page_set=page_set) |
| 25 | 25 |
| 26 def RunPageInteractions(self, action_runner): | 26 def RunPageInteractions(self, action_runner): |
| 27 # Make the scroll longer to reduce noise. | 27 # Make the scroll longer to reduce noise. |
| 28 interaction = action_runner.BeginGestureInteraction( | 28 interaction = action_runner.BeginGestureInteraction( |
| 29 'ScrollAction', is_smooth=True) | 29 'ScrollAction') |
| 30 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=300) | 30 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=300) |
| 31 interaction.End() | 31 interaction.End() |
| 32 | 32 |
| 33 class ToughCompositorWaitPage(ToughCompositorPage): | 33 class ToughCompositorWaitPage(ToughCompositorPage): |
| 34 | 34 |
| 35 def __init__(self, url, page_set): | 35 def __init__(self, url, page_set): |
| 36 super(ToughCompositorWaitPage, self).__init__(url=url, page_set=page_set) | 36 super(ToughCompositorWaitPage, self).__init__(url=url, page_set=page_set) |
| 37 | 37 |
| 38 def RunPageInteractions(self, action_runner): | 38 def RunPageInteractions(self, action_runner): |
| 39 # We scroll back and forth a few times to reduce noise in the tests. | 39 # We scroll back and forth a few times to reduce noise in the tests. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 70 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION', | 70 'http://jsbin.com/beqojupo/1/quiet?JS_FULL_SCREEN_INVALIDATION', |
| 71 # Why: Creates a large number of new tilings """ | 71 # Why: Creates a large number of new tilings """ |
| 72 'http://jsbin.com/covoqi/1/quiet?NEW_TILINGS', | 72 'http://jsbin.com/covoqi/1/quiet?NEW_TILINGS', |
| 73 ] | 73 ] |
| 74 | 74 |
| 75 for url in scroll_urls_list: | 75 for url in scroll_urls_list: |
| 76 self.AddUserStory(ToughCompositorScrollPage(url, self)) | 76 self.AddUserStory(ToughCompositorScrollPage(url, self)) |
| 77 | 77 |
| 78 for url in wait_urls_list: | 78 for url in wait_urls_list: |
| 79 self.AddUserStory(ToughCompositorWaitPage(url, self)) | 79 self.AddUserStory(ToughCompositorWaitPage(url, self)) |
| OLD | NEW |