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 class ToughImageDecodeCasesPage(page_module.Page): | 8 class ToughImageDecodeCasesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, name, page_set): | 10 def __init__(self, url, name, page_set): |
11 super(ToughImageDecodeCasesPage, self).__init__( | 11 super(ToughImageDecodeCasesPage, self).__init__( |
12 url=url, | 12 url=url, |
13 page_set=page_set, | 13 page_set=page_set, |
14 name=name, | 14 name=name, |
15 shared_page_state_class=shared_page_state.SharedMobilePageState) | 15 shared_page_state_class=shared_page_state.SharedMobilePageState) |
16 self.archive_data_file = 'data/tough_image_decode_cases.json' | 16 self.archive_data_file = 'data/tough_image_decode_cases.json' |
17 | 17 |
18 def RunPageInteractions(self, action_runner): | 18 def RunPageInteractions(self, action_runner): |
19 action_runner.WaitForJavaScriptCondition2( | 19 action_runner.WaitForJavaScriptCondition( |
20 'document.readyState === "complete"') | 20 'document.readyState === "complete"') |
21 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=5000) | 21 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=5000) |
22 with action_runner.CreateGestureInteraction('ScrollAction'): | 22 with action_runner.CreateGestureInteraction('ScrollAction'): |
23 action_runner.ScrollPage(direction='up', speed_in_pixels_per_second=5000) | 23 action_runner.ScrollPage(direction='up', speed_in_pixels_per_second=5000) |
24 | 24 |
25 class ToughImageDecodeCasesPageSet(story.StorySet): | 25 class ToughImageDecodeCasesPageSet(story.StorySet): |
26 | 26 |
27 """ | 27 """ |
28 Description: A collection of difficult image decode tests | 28 Description: A collection of difficult image decode tests |
29 """ | 29 """ |
30 | 30 |
31 def __init__(self): | 31 def __init__(self): |
32 super(ToughImageDecodeCasesPageSet, self).__init__( | 32 super(ToughImageDecodeCasesPageSet, self).__init__( |
33 archive_data_file='data/tough_image_decode_cases.json', | 33 archive_data_file='data/tough_image_decode_cases.json', |
34 cloud_storage_bucket=story.PUBLIC_BUCKET) | 34 cloud_storage_bucket=story.PUBLIC_BUCKET) |
35 | 35 |
36 page_name_list = [ | 36 page_name_list = [ |
37 'http://localhost:9000/cats-unscaled.html', | 37 'http://localhost:9000/cats-unscaled.html', |
38 'http://localhost:9000/cats-viewport-width.html' | 38 'http://localhost:9000/cats-viewport-width.html' |
39 ] | 39 ] |
40 | 40 |
41 for name in page_name_list: | 41 for name in page_name_list: |
42 self.AddStory(ToughImageDecodeCasesPage( | 42 self.AddStory(ToughImageDecodeCasesPage( |
43 name, name, self)) | 43 name, name, self)) |
OLD | NEW |