| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 shared_page_state | 5 from telemetry.page import shared_page_state |
| 6 from telemetry import story | 6 from telemetry import story |
| 7 | 7 |
| 8 | 8 |
| 9 class NoOpPage(page_module.Page): | 9 class NoOpPage(page_module.Page): |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 with action_runner.CreateGestureInteraction('ScrollAction'): | 35 with action_runner.CreateGestureInteraction('ScrollAction'): |
| 36 action_runner.ScrollPage(direction='down', use_touch=True, | 36 action_runner.ScrollPage(direction='down', use_touch=True, |
| 37 speed_in_pixels_per_second=300, distance=1500) | 37 speed_in_pixels_per_second=300, distance=1500) |
| 38 | 38 |
| 39 | 39 |
| 40 class KeyNoOpCasesPageSet(story.StorySet): | 40 class KeyNoOpCasesPageSet(story.StorySet): |
| 41 | 41 |
| 42 """ Key no-op cases """ | 42 """ Key no-op cases """ |
| 43 | 43 |
| 44 def __init__(self): | 44 def __init__(self): |
| 45 super(KeyNoOpCasesPageSet, self).__init__(verify_names=True) | 45 super(KeyNoOpCasesPageSet, self).__init__() |
| 46 | 46 |
| 47 # Why: An infinite rAF loop which does not modify the page should incur | 47 # Why: An infinite rAF loop which does not modify the page should incur |
| 48 # minimal activity. | 48 # minimal activity. |
| 49 self.AddStory(NoOpPage('file://key_noop_cases/no_op_raf.html', self)) | 49 self.AddStory(NoOpPage('file://key_noop_cases/no_op_raf.html', self)) |
| 50 | 50 |
| 51 # Why: An infinite setTimeout loop which does not modify the page should | 51 # Why: An infinite setTimeout loop which does not modify the page should |
| 52 # incur minimal activity. | 52 # incur minimal activity. |
| 53 self.AddStory(NoOpPage('file://key_noop_cases/no_op_settimeout.html', self)) | 53 self.AddStory(NoOpPage('file://key_noop_cases/no_op_settimeout.html', self)) |
| 54 | 54 |
| 55 # Why: Scrolling an empty, unscrollable page should have no expensive side | 55 # Why: Scrolling an empty, unscrollable page should have no expensive side |
| 56 # effects, as overscroll is suppressed in such cases. | 56 # effects, as overscroll is suppressed in such cases. |
| 57 self.AddStory(NoOpTouchScrollPage( | 57 self.AddStory(NoOpTouchScrollPage( |
| 58 'file://key_noop_cases/no_op_scroll.html', self)) | 58 'file://key_noop_cases/no_op_scroll.html', self)) |
| 59 | 59 |
| 60 # Why: Feeding a stream of touch events to a no-op handler should be cheap. | 60 # Why: Feeding a stream of touch events to a no-op handler should be cheap. |
| 61 self.AddStory(NoOpTouchScrollPage( | 61 self.AddStory(NoOpTouchScrollPage( |
| 62 'file://key_noop_cases/no_op_touch_handler.html', self)) | 62 'file://key_noop_cases/no_op_touch_handler.html', self)) |
| OLD | NEW |