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 class PolymerPage(page_module.Page): | 7 class PolymerPage(page_module.Page): |
8 | 8 |
9 def __init__(self, url, page_set): | 9 def __init__(self, url, page_set): |
10 super(PolymerPage, self).__init__( | 10 super(PolymerPage, self).__init__( |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 element_function=element_function) | 133 element_function=element_function) |
134 interaction.End() | 134 interaction.End() |
135 interaction = action_runner.BeginInteraction('Scroll_Page', is_smooth=True) | 135 interaction = action_runner.BeginInteraction('Scroll_Page', is_smooth=True) |
136 action_runner.ScrollElement(use_touch=True, | 136 action_runner.ScrollElement(use_touch=True, |
137 direction='up', | 137 direction='up', |
138 distance='900', | 138 distance='900', |
139 element_function=element_function) | 139 element_function=element_function) |
140 interaction.End() | 140 interaction.End() |
141 | 141 |
142 def TouchEverything(self, action_runner): | 142 def TouchEverything(self, action_runner): |
143 tappable_types = ['paper-toggle-button', 'paper-button', 'paper-checkbox', | 143 tappable_types = [ |
144 'paper-icon-button', 'paper-radio-button', 'paper-tab', 'paper-fab', | 144 'paper-button', |
145 'x-shadow'] | 145 'paper-checkbox', |
| 146 'paper-fab', |
| 147 'paper-icon-button', |
| 148 # crbug.com/394756 |
| 149 # 'paper-radio-button', |
| 150 'paper-tab', |
| 151 'paper-toggle-button', |
| 152 'x-shadow', |
| 153 ] |
146 for tappable_type in tappable_types: | 154 for tappable_type in tappable_types: |
147 self.DoActionOnWidgetType(action_runner, tappable_type, self.TapWidget) | 155 self.DoActionOnWidgetType(action_runner, tappable_type, self.TapWidget) |
148 swipeable_types = ['paper-slider'] | 156 swipeable_types = ['paper-slider'] |
149 for swipeable_type in swipeable_types: | 157 for swipeable_type in swipeable_types: |
150 self.DoActionOnWidgetType(action_runner, swipeable_type, self.SwipeWidget) | 158 self.DoActionOnWidgetType(action_runner, swipeable_type, self.SwipeWidget) |
151 | 159 |
152 def DoActionOnWidgetType(self, action_runner, widget_type, action_function): | 160 def DoActionOnWidgetType(self, action_runner, widget_type, action_function): |
153 # Find all widgets of this type, but skip any that are disabled or are | 161 # Find all widgets of this type, but skip any that are disabled or are |
154 # currently active as they typically don't produce animation frames. | 162 # currently active as they typically don't produce animation frames. |
155 element_list_query = (self.iframe_js + | 163 element_list_query = (self.iframe_js + |
(...skipping 30 matching lines...) Expand all Loading... |
186 def __init__(self): | 194 def __init__(self): |
187 super(PolymerPageSet, self).__init__( | 195 super(PolymerPageSet, self).__init__( |
188 user_agent_type='mobile', | 196 user_agent_type='mobile', |
189 archive_data_file='data/polymer.json', | 197 archive_data_file='data/polymer.json', |
190 bucket=page_set_module.PUBLIC_BUCKET) | 198 bucket=page_set_module.PUBLIC_BUCKET) |
191 | 199 |
192 self.AddPage(PolymerCalculatorPage(self)) | 200 self.AddPage(PolymerCalculatorPage(self)) |
193 self.AddPage(PolymerShadowPage(self)) | 201 self.AddPage(PolymerShadowPage(self)) |
194 | 202 |
195 # Polymer Sampler subpages that are interesting to tap / swipe elements on | 203 # Polymer Sampler subpages that are interesting to tap / swipe elements on |
196 TAPPABLE_PAGES = ['paper-toggle-button', 'paper-button', 'paper-checkbox', | 204 TAPPABLE_PAGES = [ |
197 'paper-icon-button', 'paper-radio-button', 'paper-tabs', 'paper-fab', | 205 'paper-button', |
198 'paper-shadow'] | 206 'paper-checkbox', |
| 207 'paper-fab', |
| 208 'paper-icon-button', |
| 209 # crbug.com/394756 |
| 210 # 'paper-radio-button', |
| 211 'paper-shadow', |
| 212 'paper-tabs', |
| 213 'paper-toggle-button', |
| 214 ] |
199 for p in TAPPABLE_PAGES: | 215 for p in TAPPABLE_PAGES: |
200 self.AddPage(PolymerSampler(self, p)) | 216 self.AddPage(PolymerSampler(self, p)) |
201 | 217 |
202 # Polymer Sampler subpages that are interesting to scroll | 218 # Polymer Sampler subpages that are interesting to scroll |
203 SCROLLABLE_PAGES = ['core-scroll-header-panel'] | 219 SCROLLABLE_PAGES = ['core-scroll-header-panel'] |
204 for p in SCROLLABLE_PAGES: | 220 for p in SCROLLABLE_PAGES: |
205 self.AddPage(PolymerSampler(self, p, scrolling_page=True)) | 221 self.AddPage(PolymerSampler(self, p, scrolling_page=True)) |
OLD | NEW |