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 ToughSchedulingCasesPage(page_module.Page): | 8 class ToughSchedulingCasesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
11 super(ToughSchedulingCasesPage, self).__init__( | 11 super(ToughSchedulingCasesPage, 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_scheduling_cases.json' | 14 self.archive_data_file = 'data/tough_scheduling_cases.json' |
15 | 15 |
16 def RunPageInteractions(self, action_runner): | 16 def RunPageInteractions(self, action_runner): |
17 interaction = action_runner.BeginGestureInteraction( | 17 interaction = action_runner.BeginGestureInteraction( |
18 'ScrollAction', is_smooth=True) | 18 'ScrollAction', is_smooth=True) |
19 action_runner.ScrollPage() | 19 action_runner.ScrollPage() |
20 interaction.End() | 20 interaction.End() |
21 | 21 |
22 | 22 |
23 class Page1(ToughSchedulingCasesPage): | 23 class Page1(ToughSchedulingCasesPage): |
24 | 24 |
25 """ Why: Simulate oversubscribed main thread """ | 25 """Why: Simulate oversubscribed main thread.""" |
26 | 26 |
27 def __init__(self, page_set): | 27 def __init__(self, page_set): |
28 super(Page1, self).__init__( | 28 super(Page1, self).__init__( |
29 url='file://tough_scheduling_cases/simple_text_page.html?main_busy', | 29 url='file://tough_scheduling_cases/simple_text_page.html?main_busy', |
30 page_set=page_set) | 30 page_set=page_set) |
31 | 31 |
32 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.008}} | 32 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.008}} |
33 | 33 |
34 | 34 |
35 class Page2(ToughSchedulingCasesPage): | 35 class Page2(ToughSchedulingCasesPage): |
36 | 36 |
37 """ Why: Simulate oversubscribed main thread """ | 37 """Why: Simulate oversubscribed main thread.""" |
38 | 38 |
39 def __init__(self, page_set): | 39 def __init__(self, page_set): |
40 super(Page2, self).__init__( | 40 super(Page2, self).__init__( |
41 # pylint: disable=C0301 | 41 # pylint: disable=C0301 |
42 url='file://tough_scheduling_cases/simple_text_page.html?main_very_busy', | 42 url='file://tough_scheduling_cases/simple_text_page.html?main_very_busy' , |
43 page_set=page_set) | 43 page_set=page_set) |
44 | 44 |
45 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.024}} | 45 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.024}} |
46 | 46 |
47 | 47 |
48 class Page3(ToughSchedulingCasesPage): | 48 class Page3(ToughSchedulingCasesPage): |
49 | 49 |
50 """ Why: Simulate a page with a a few graphics layers """ | 50 """Why: Simulate a page with a a few graphics layers.""" |
51 | 51 |
52 def __init__(self, page_set): | 52 def __init__(self, page_set): |
53 super(Page3, self).__init__( | 53 super(Page3, self).__init__( |
54 # pylint: disable=C0301 | 54 # pylint: disable=C0301 |
55 url='file://tough_scheduling_cases/simple_text_page.html?medium_layers', | 55 url='file://tough_scheduling_cases/simple_text_page.html?medium_layers', |
56 page_set=page_set) | 56 page_set=page_set) |
57 | 57 |
58 self.synthetic_delays = { | 58 self.synthetic_delays = { |
59 'cc.DrawAndSwap': {'target_duration': 0.004}, | 59 'cc.DrawAndSwap': {'target_duration': 0.004}, |
60 'gpu.PresentingFrame': {'target_duration': 0.004}, | 60 'gpu.PresentingFrame': {'target_duration': 0.004}, |
61 'cc.BeginMainFrame': {'target_duration': 0.004} | 61 'cc.BeginMainFrame': {'target_duration': 0.004} |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 class Page4(ToughSchedulingCasesPage): | 65 class Page4(ToughSchedulingCasesPage): |
66 | 66 |
67 """ Why: Simulate a page with many graphics layers """ | 67 """Why: Simulate a page with many graphics layers.""" |
68 | 68 |
69 def __init__(self, page_set): | 69 def __init__(self, page_set): |
70 super(Page4, self).__init__( | 70 super(Page4, self).__init__( |
71 # pylint: disable=C0301 | 71 # pylint: disable=C0301 |
72 url='file://tough_scheduling_cases/simple_text_page.html?many_layers', | 72 url='file://tough_scheduling_cases/simple_text_page.html?many_layers', |
73 page_set=page_set) | 73 page_set=page_set) |
74 | 74 |
75 self.synthetic_delays = { | 75 self.synthetic_delays = { |
76 'cc.DrawAndSwap': {'target_duration': 0.012}, | 76 'cc.DrawAndSwap': {'target_duration': 0.012}, |
77 'gpu.PresentingFrame': {'target_duration': 0.012}, | 77 'gpu.PresentingFrame': {'target_duration': 0.012}, |
78 'cc.BeginMainFrame': {'target_duration': 0.012} | 78 'cc.BeginMainFrame': {'target_duration': 0.012} |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 class Page5(ToughSchedulingCasesPage): | 82 class Page5(ToughSchedulingCasesPage): |
83 | 83 |
84 """ Why: Simulate a page with expensive recording and rasterization """ | 84 """Why: Simulate a page with expensive recording and rasterization.""" |
85 | 85 |
86 def __init__(self, page_set): | 86 def __init__(self, page_set): |
87 super(Page5, self).__init__( | 87 super(Page5, self).__init__( |
88 # pylint: disable=C0301 | 88 # pylint: disable=C0301 |
89 url='file://tough_scheduling_cases/simple_text_page.html?medium_raster', | 89 url='file://tough_scheduling_cases/simple_text_page.html?medium_raster', |
90 page_set=page_set) | 90 page_set=page_set) |
91 | 91 |
92 self.synthetic_delays = { | 92 self.synthetic_delays = { |
93 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, | 93 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, |
94 'cc.BeginMainFrame': {'target_duration': 0.004}, | 94 'cc.BeginMainFrame': {'target_duration': 0.004}, |
95 'gpu.AsyncTexImage': {'target_duration': 0.004} | 95 'gpu.AsyncTexImage': {'target_duration': 0.004} |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 class Page6(ToughSchedulingCasesPage): | 99 class Page6(ToughSchedulingCasesPage): |
100 | 100 |
101 """ Why: Simulate a page with expensive recording and rasterization """ | 101 """Why: Simulate a page with expensive recording and rasterization.""" |
102 | 102 |
103 def __init__(self, page_set): | 103 def __init__(self, page_set): |
104 super(Page6, self).__init__( | 104 super(Page6, self).__init__( |
105 # pylint: disable=C0301 | 105 # pylint: disable=C0301 |
106 url='file://tough_scheduling_cases/simple_text_page.html?heavy_raster', | 106 url='file://tough_scheduling_cases/simple_text_page.html?heavy_raster', |
107 page_set=page_set) | 107 page_set=page_set) |
108 | 108 |
109 self.synthetic_delays = { | 109 self.synthetic_delays = { |
110 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, | 110 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, |
111 'cc.BeginMainFrame': {'target_duration': 0.024}, | 111 'cc.BeginMainFrame': {'target_duration': 0.024}, |
112 'gpu.AsyncTexImage': {'target_duration': 0.024} | 112 'gpu.AsyncTexImage': {'target_duration': 0.024} |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 class Page7(ToughSchedulingCasesPage): | 116 class Page7(ToughSchedulingCasesPage): |
117 | 117 |
118 """ Why: Medium cost touch handler """ | 118 """Why: Medium cost touch handler.""" |
119 | 119 |
120 def __init__(self, page_set): | 120 def __init__(self, page_set): |
121 super(Page7, self).__init__( | 121 super(Page7, self).__init__( |
122 # pylint: disable=C0301 | 122 # pylint: disable=C0301 |
123 url='file://tough_scheduling_cases/touch_handler_scrolling.html?medium_han dler', | 123 url='file://tough_scheduling_cases/touch_handler_scrolling.html?medium_h andler', |
124 page_set=page_set) | 124 page_set=page_set) |
125 | 125 |
126 self.synthetic_delays = {'blink.HandleInputEvent': | 126 self.synthetic_delays = {'blink.HandleInputEvent': |
127 {'target_duration': 0.008}} | 127 {'target_duration': 0.008}} |
128 | 128 |
129 | 129 |
130 class Page8(ToughSchedulingCasesPage): | 130 class Page8(ToughSchedulingCasesPage): |
131 | 131 |
132 """ Why: Slow touch handler """ | 132 """Why: Slow touch handler.""" |
133 | 133 |
134 def __init__(self, page_set): | 134 def __init__(self, page_set): |
135 super(Page8, self).__init__( | 135 super(Page8, self).__init__( |
136 # pylint: disable=C0301 | 136 # pylint: disable=C0301 |
137 url='file://tough_scheduling_cases/touch_handler_scrolling.html?slow_handl er', | 137 url='file://tough_scheduling_cases/touch_handler_scrolling.html?slow_han dler', |
138 page_set=page_set) | 138 page_set=page_set) |
139 | 139 |
140 self.synthetic_delays = {'blink.HandleInputEvent': | 140 self.synthetic_delays = {'blink.HandleInputEvent': |
141 {'target_duration': 0.024}} | 141 {'target_duration': 0.024}} |
142 | 142 |
143 | 143 |
144 class Page9(ToughSchedulingCasesPage): | 144 class Page9(ToughSchedulingCasesPage): |
145 | 145 |
146 """ Why: Touch handler that often takes a long time """ | 146 """Why: Touch handler that often takes a long time.""" |
147 | 147 |
148 def __init__(self, page_set): | 148 def __init__(self, page_set): |
149 super(Page9, self).__init__( | 149 super(Page9, self).__init__( |
150 # pylint: disable=C0301 | 150 # pylint: disable=C0301 |
151 url='file://tough_scheduling_cases/touch_handler_scrolling.html?janky_hand ler', | 151 url='file://tough_scheduling_cases/touch_handler_scrolling.html?janky_ha ndler', |
152 page_set=page_set) | 152 page_set=page_set) |
153 | 153 |
154 self.synthetic_delays = {'blink.HandleInputEvent': | 154 self.synthetic_delays = {'blink.HandleInputEvent': |
155 {'target_duration': 0.024, 'mode': 'alternating'} | 155 {'target_duration': 0.024, 'mode': 'alternating'} |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 class Page10(ToughSchedulingCasesPage): | 159 class Page10(ToughSchedulingCasesPage): |
160 | 160 |
161 """ Why: Touch handler that occasionally takes a long time """ | 161 """Why: Touch handler that occasionally takes a long time.""" |
162 | 162 |
163 def __init__(self, page_set): | 163 def __init__(self, page_set): |
164 super(Page10, self).__init__( | 164 super(Page10, self).__init__( |
165 # pylint: disable=C0301 | 165 # pylint: disable=C0301 |
166 url='file://tough_scheduling_cases/touch_handler_scrolling.html?occasional ly_janky_handler', | 166 url='file://tough_scheduling_cases/touch_handler_scrolling.html?occasion ally_janky_handler', |
167 page_set=page_set) | 167 page_set=page_set) |
168 | 168 |
169 self.synthetic_delays = {'blink.HandleInputEvent': | 169 self.synthetic_delays = {'blink.HandleInputEvent': |
170 {'target_duration': 0.024, 'mode': 'oneshot'}} | 170 {'target_duration': 0.024, 'mode': 'oneshot'}} |
171 | 171 |
172 | 172 |
173 class Page11(ToughSchedulingCasesPage): | 173 class Page11(ToughSchedulingCasesPage): |
174 | 174 |
175 """ Why: Super expensive touch handler causes browser to scroll after a | 175 """Why: Super expensive touch handler causes browser to scroll after a |
176 timeout. | 176 timeout.""" |
177 """ | |
178 | 177 |
179 def __init__(self, page_set): | 178 def __init__(self, page_set): |
180 super(Page11, self).__init__( | 179 super(Page11, self).__init__( |
181 # pylint: disable=C0301 | 180 # pylint: disable=C0301 |
182 url='file://tough_scheduling_cases/touch_handler_scrolling.html?super_slow _handler', | 181 url='file://tough_scheduling_cases/touch_handler_scrolling.html?super_sl ow_handler', |
183 page_set=page_set) | 182 page_set=page_set) |
184 | 183 |
185 self.synthetic_delays = {'blink.HandleInputEvent': | 184 self.synthetic_delays = {'blink.HandleInputEvent': |
186 {'target_duration': 0.2}} | 185 {'target_duration': 0.2}} |
187 | 186 |
188 | 187 |
189 class Page12(ToughSchedulingCasesPage): | 188 class Page12(ToughSchedulingCasesPage): |
190 | 189 |
191 """ Why: Super expensive touch handler that only occupies a part of the page. | 190 """Why: Super expensive touch handler that only occupies a part of the page. |
192 """ | 191 """ |
193 | 192 |
194 def __init__(self, page_set): | 193 def __init__(self, page_set): |
195 super(Page12, self).__init__( | 194 super(Page12, self).__init__( |
196 url='file://tough_scheduling_cases/div_touch_handler.html', | 195 url='file://tough_scheduling_cases/div_touch_handler.html', |
197 page_set=page_set) | 196 page_set=page_set) |
198 | 197 |
199 self.synthetic_delays = {'blink.HandleInputEvent': {'target_duration': 0.2}} | 198 self.synthetic_delays = {'blink.HandleInputEvent': {'target_duration': 0.2}} |
200 | 199 |
201 | 200 |
202 class Page13(ToughSchedulingCasesPage): | 201 class Page13(ToughSchedulingCasesPage): |
203 | 202 |
204 """ Why: Test a moderately heavy requestAnimationFrame handler """ | 203 """Why: Test a moderately heavy requestAnimationFrame handler.""" |
205 | 204 |
206 def __init__(self, page_set): | 205 def __init__(self, page_set): |
207 super(Page13, self).__init__( | 206 super(Page13, self).__init__( |
208 url='file://tough_scheduling_cases/raf.html?medium_handler', | 207 url='file://tough_scheduling_cases/raf.html?medium_handler', |
209 page_set=page_set) | 208 page_set=page_set) |
210 | 209 |
211 self.synthetic_delays = { | 210 self.synthetic_delays = { |
212 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, | 211 'cc.RasterRequiredForActivation': {'target_duration': 0.004}, |
213 'cc.BeginMainFrame': {'target_duration': 0.004}, | 212 'cc.BeginMainFrame': {'target_duration': 0.004}, |
214 'gpu.AsyncTexImage': {'target_duration': 0.004} | 213 'gpu.AsyncTexImage': {'target_duration': 0.004} |
215 } | 214 } |
216 | 215 |
217 | 216 |
218 class Page14(ToughSchedulingCasesPage): | 217 class Page14(ToughSchedulingCasesPage): |
219 | 218 |
220 """ Why: Test a moderately heavy requestAnimationFrame handler """ | 219 """Why: Test a moderately heavy requestAnimationFrame handler.""" |
221 | 220 |
222 def __init__(self, page_set): | 221 def __init__(self, page_set): |
223 super(Page14, self).__init__( | 222 super(Page14, self).__init__( |
224 url='file://tough_scheduling_cases/raf.html?heavy_handler', | 223 url='file://tough_scheduling_cases/raf.html?heavy_handler', |
225 page_set=page_set) | 224 page_set=page_set) |
226 | 225 |
227 self.synthetic_delays = { | 226 self.synthetic_delays = { |
228 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, | 227 'cc.RasterRequiredForActivation': {'target_duration': 0.024}, |
229 'cc.BeginMainFrame': {'target_duration': 0.024}, | 228 'cc.BeginMainFrame': {'target_duration': 0.024}, |
230 'gpu.AsyncTexImage': {'target_duration': 0.024} | 229 'gpu.AsyncTexImage': {'target_duration': 0.024} |
231 } | 230 } |
232 | 231 |
233 | 232 |
234 class Page15(ToughSchedulingCasesPage): | 233 class Page15(ToughSchedulingCasesPage): |
235 | 234 |
236 """ Why: Simulate a heavily GPU bound page """ | 235 """Why: Simulate a heavily GPU bound page.""" |
237 | 236 |
238 def __init__(self, page_set): | 237 def __init__(self, page_set): |
239 super(Page15, self).__init__( | 238 super(Page15, self).__init__( |
240 url='file://tough_scheduling_cases/raf.html?gpu_bound', | 239 url='file://tough_scheduling_cases/raf.html?gpu_bound', |
241 page_set=page_set) | 240 page_set=page_set) |
242 | 241 |
243 self.synthetic_delays = {'gpu.PresentingFrame': {'target_duration': 0.1}} | 242 self.synthetic_delays = {'gpu.PresentingFrame': {'target_duration': 0.1}} |
244 | 243 |
245 | 244 |
246 class Page16(ToughSchedulingCasesPage): | 245 class Page16(ToughSchedulingCasesPage): |
247 | 246 |
248 """ Why: Test a requestAnimationFrame handler with a heavy first frame """ | 247 """Why: Test a requestAnimationFrame handler with a heavy first frame.""" |
249 | 248 |
250 def __init__(self, page_set): | 249 def __init__(self, page_set): |
251 super(Page16, self).__init__( | 250 super(Page16, self).__init__( |
252 url='file://tough_scheduling_cases/raf.html?heavy_first_frame', | 251 url='file://tough_scheduling_cases/raf.html?heavy_first_frame', |
253 page_set=page_set) | 252 page_set=page_set) |
254 | 253 |
255 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.15, | 254 self.synthetic_delays = {'cc.BeginMainFrame': {'target_duration': 0.15, |
256 'mode': 'oneshot'}} | 255 'mode': 'oneshot'}} |
257 | 256 |
258 | 257 |
259 class Page17(ToughSchedulingCasesPage): | 258 class Page17(ToughSchedulingCasesPage): |
260 | 259 |
261 """ Why: Medium stress test for the scheduler """ | 260 """Why: Medium stress test for the scheduler.""" |
262 | 261 |
263 def __init__(self, page_set): | 262 def __init__(self, page_set): |
264 super(Page17, self).__init__( | 263 super(Page17, self).__init__( |
265 url='file://tough_scheduling_cases/raf_touch_animation.html?medium', | 264 url='file://tough_scheduling_cases/raf_touch_animation.html?medium', |
266 page_set=page_set) | 265 page_set=page_set) |
267 | 266 |
268 self.synthetic_delays = { | 267 self.synthetic_delays = { |
269 'cc.DrawAndSwap': {'target_duration': 0.004}, | 268 'cc.DrawAndSwap': {'target_duration': 0.004}, |
270 'cc.BeginMainFrame': {'target_duration': 0.004} | 269 'cc.BeginMainFrame': {'target_duration': 0.004} |
271 } | 270 } |
272 | 271 |
273 | 272 |
274 class Page18(ToughSchedulingCasesPage): | 273 class Page18(ToughSchedulingCasesPage): |
275 | 274 |
276 """ Why: Heavy stress test for the scheduler """ | 275 """Why: Heavy stress test for the scheduler.""" |
277 | 276 |
278 def __init__(self, page_set): | 277 def __init__(self, page_set): |
279 super(Page18, self).__init__( | 278 super(Page18, self).__init__( |
280 url='file://tough_scheduling_cases/raf_touch_animation.html?heavy', | 279 url='file://tough_scheduling_cases/raf_touch_animation.html?heavy', |
281 page_set=page_set) | 280 page_set=page_set) |
282 | 281 |
283 self.synthetic_delays = { | 282 self.synthetic_delays = { |
284 'cc.DrawAndSwap': {'target_duration': 0.012}, | 283 'cc.DrawAndSwap': {'target_duration': 0.012}, |
285 'cc.BeginMainFrame': {'target_duration': 0.012} | 284 'cc.BeginMainFrame': {'target_duration': 0.012} |
286 } | 285 } |
287 | 286 |
288 | 287 |
289 class Page19(ToughSchedulingCasesPage): | 288 class Page19(ToughSchedulingCasesPage): |
290 | 289 |
291 """ Why: Both main and impl thread animating concurrently """ | 290 """Why: Both main and impl thread animating concurrently.""" |
292 | 291 |
293 def __init__(self, page_set): | 292 def __init__(self, page_set): |
294 super(Page19, self).__init__( | 293 super(Page19, self).__init__( |
295 url='file://tough_scheduling_cases/split_animation.html', | 294 url='file://tough_scheduling_cases/split_animation.html', |
296 page_set=page_set) | 295 page_set=page_set) |
297 | 296 |
298 def RunPageInteractions(self, action_runner): | 297 def RunPageInteractions(self, action_runner): |
299 action_runner.Wait(3) | 298 action_runner.Wait(3) |
300 | 299 |
301 | 300 |
302 class Page20(ToughSchedulingCasesPage): | 301 class Page20(ToughSchedulingCasesPage): |
303 | 302 |
304 """ Why: Simple JS touch dragging """ | 303 """Why: Simple JS touch dragging.""" |
305 | 304 |
306 def __init__(self, page_set): | 305 def __init__(self, page_set): |
307 super(Page20, self).__init__( | 306 super(Page20, self).__init__( |
308 url='file://tough_scheduling_cases/simple_touch_drag.html', | 307 url='file://tough_scheduling_cases/simple_touch_drag.html', |
309 page_set=page_set) | 308 page_set=page_set) |
310 | 309 |
311 def RunPageInteractions(self, action_runner): | 310 def RunPageInteractions(self, action_runner): |
312 interaction = action_runner.BeginGestureInteraction( | 311 interaction = action_runner.BeginGestureInteraction( |
313 'ScrollAction', is_smooth=True) | 312 'ScrollAction', is_smooth=True) |
314 action_runner.ScrollElement( | 313 action_runner.ScrollElement( |
315 selector='#card', | 314 selector='#card', |
316 use_touch=True, | 315 use_touch=True, |
317 direction='up', | 316 direction='up', |
318 speed_in_pixels_per_second=150, | 317 speed_in_pixels_per_second=150, |
319 distance=400) | 318 distance=400) |
320 interaction.End() | 319 interaction.End() |
321 | 320 |
322 | 321 |
323 class EmptyTouchHandlerPage(ToughSchedulingCasesPage): | 322 class EmptyTouchHandlerPage(ToughSchedulingCasesPage): |
324 | 323 |
325 """ Why: Scrolling on a page with a touch handler that consumes no events but | 324 """Why: Scrolling on a page with a touch handler that consumes no events but |
326 may be slow """ | 325 may be slow.""" |
327 | 326 |
328 def __init__(self, name, desktop, slow_handler, bounce, page_set): | 327 def __init__(self, name, desktop, slow_handler, bounce, page_set): |
329 super(EmptyTouchHandlerPage, self).__init__( | 328 super(EmptyTouchHandlerPage, self).__init__( |
330 url='file://tough_scheduling_cases/empty_touch_handler' + | 329 url='file://tough_scheduling_cases/empty_touch_handler' + |
331 ('_desktop' if desktop else '') + '.html?' + name, | 330 ('_desktop' if desktop else '') + '.html?' + name, |
332 page_set=page_set) | 331 page_set=page_set) |
333 | 332 |
334 if slow_handler: | 333 if slow_handler: |
335 self.synthetic_delays = { | 334 self.synthetic_delays = { |
336 'blink.HandleInputEvent': {'target_duration': 0.2} | 335 'blink.HandleInputEvent': {'target_duration': 0.2} |
337 } | 336 } |
338 | 337 |
339 self.bounce = bounce | 338 self.bounce = bounce |
340 | 339 |
341 def RunPageInteractions(self, action_runner): | 340 def RunPageInteractions(self, action_runner): |
342 if self.bounce: | 341 if self.bounce: |
343 interaction = action_runner.BeginGestureInteraction( | 342 interaction = action_runner.BeginGestureInteraction( |
344 'ScrollBounceAction', is_smooth=True) | 343 'ScrollBounceAction', is_smooth=True) |
345 action_runner.ScrollBouncePage() | 344 action_runner.ScrollBouncePage() |
346 interaction.End() | 345 interaction.End() |
347 else: | 346 else: |
348 interaction = action_runner.BeginGestureInteraction( | 347 interaction = action_runner.BeginGestureInteraction( |
349 'ScrollAction', is_smooth=True) | 348 'ScrollAction', is_smooth=True) |
350 # Speed and distance are tuned to run exactly as long as a scroll | 349 # Speed and distance are tuned to run exactly as long as a scroll |
351 # bounce. | 350 # bounce. |
352 action_runner.ScrollPage(use_touch=True, speed_in_pixels_per_second=400, | 351 action_runner.ScrollPage(use_touch=True, speed_in_pixels_per_second=400, |
353 distance=2100) | 352 distance=2100) |
354 interaction.End() | 353 interaction.End() |
355 | 354 |
356 | 355 |
357 class SynchronizedScrollOffsetPage(ToughSchedulingCasesPage): | 356 class SynchronizedScrollOffsetPage(ToughSchedulingCasesPage): |
358 | 357 |
359 """Why: For measuring the latency of scroll-synchronized effects.""" | 358 """Why: For measuring the latency of scroll-synchronized effects.""" |
360 | 359 |
361 def __init__(self, page_set): | 360 def __init__(self, page_set): |
362 super(SynchronizedScrollOffsetPage, self).__init__( | 361 super(SynchronizedScrollOffsetPage, self).__init__( |
363 url='file://tough_scheduling_cases/sync_scroll_offset.html', | 362 url='file://tough_scheduling_cases/sync_scroll_offset.html', |
364 page_set=page_set) | 363 page_set=page_set) |
365 | 364 |
366 def RunPageInteractions(self, action_runner): | 365 def RunPageInteractions(self, action_runner): |
367 interaction = action_runner.BeginGestureInteraction( | 366 interaction = action_runner.BeginGestureInteraction( |
368 'ScrollBounceAction', is_smooth=True) | 367 'ScrollBounceAction', is_smooth=True) |
369 action_runner.ScrollBouncePage() | 368 action_runner.ScrollBouncePage() |
370 interaction.End() | 369 interaction.End() |
371 | 370 |
372 | 371 |
373 class ToughSchedulingCasesPageSet(page_set_module.PageSet): | 372 class ToughSchedulingCasesPageSet(page_set_module.PageSet): |
374 | 373 |
375 """ Tough scheduler latency test cases """ | 374 """Tough scheduler latency test cases.""" |
376 | 375 |
377 def __init__(self): | 376 def __init__(self): |
378 super(ToughSchedulingCasesPageSet, self).__init__( | 377 super(ToughSchedulingCasesPageSet, self).__init__( |
379 user_agent_type='mobile', | 378 user_agent_type='mobile', |
380 archive_data_file='data/tough_scheduling_cases.json', | 379 archive_data_file='data/tough_scheduling_cases.json', |
381 bucket=page_set_module.INTERNAL_BUCKET) | 380 bucket=page_set_module.INTERNAL_BUCKET) |
382 | 381 |
383 # Why: Simple scrolling baseline | 382 # Why: Simple scrolling baseline |
384 self.AddUserStory(ToughSchedulingCasesPage( | 383 self.AddUserStory(ToughSchedulingCasesPage( |
385 'file://tough_scheduling_cases/simple_text_page.html', | 384 'file://tough_scheduling_cases/simple_text_page.html', |
386 self)) | 385 self)) |
387 self.AddUserStory(Page1(self)) | 386 self.AddUserStory(Page1(self)) |
388 self.AddUserStory(Page2(self)) | 387 self.AddUserStory(Page2(self)) |
389 self.AddUserStory(Page3(self)) | 388 self.AddUserStory(Page3(self)) |
390 self.AddUserStory(Page4(self)) | 389 self.AddUserStory(Page4(self)) |
391 # Disabled until crbug.com/413829 is fixed. | 390 # Disabled until crbug.com/413829 is fixed. |
392 # self.AddUserStory(Page5(self)) | 391 # self.AddUserStory(Page5(self)) |
393 # Disabled because of crbug.com/413829 and flakiness crbug.com/368532 | 392 # Disabled because of crbug.com/413829 and flakiness crbug.com/368532 |
394 # self.AddUserStory(Page6(self)) | 393 # self.AddUserStory(Page6(self)) |
395 # Why: Touch handler scrolling baseline | 394 # Why: Touch handler scrolling baseline |
396 self.AddUserStory(ToughSchedulingCasesPage( | 395 self.AddUserStory(ToughSchedulingCasesPage( |
397 'file://tough_scheduling_cases/touch_handler_scrolling.html', | 396 'file://tough_scheduling_cases/touch_handler_scrolling.html', |
398 self)) | 397 self)) |
399 self.AddUserStory(Page7(self)) | 398 self.AddUserStory(Page7(self)) |
400 self.AddUserStory(Page8(self)) | 399 self.AddUserStory(Page8(self)) |
401 self.AddUserStory(Page9(self)) | 400 self.AddUserStory(Page9(self)) |
402 self.AddUserStory(Page10(self)) | 401 self.AddUserStory(Page10(self)) |
403 self.AddUserStory(Page11(self)) | 402 self.AddUserStory(Page11(self)) |
404 self.AddUserStory(Page12(self)) | 403 self.AddUserStory(Page12(self)) |
405 # Why: requestAnimationFrame scrolling baseline | 404 # Why: requestAnimationFrame scrolling baseline |
406 self.AddUserStory(ToughSchedulingCasesPage( | 405 self.AddUserStory(ToughSchedulingCasesPage( |
407 'file://tough_scheduling_cases/raf.html', | 406 'file://tough_scheduling_cases/raf.html', |
408 self)) | 407 self)) |
409 # Why: Test canvas blocking behavior | 408 # Why: Test canvas blocking behavior |
410 self.AddUserStory(ToughSchedulingCasesPage( | 409 self.AddUserStory(ToughSchedulingCasesPage( |
411 'file://tough_scheduling_cases/raf_canvas.html', | 410 'file://tough_scheduling_cases/raf_canvas.html', |
412 self)) | 411 self)) |
413 # Disabled until crbug.com/413829 is fixed. | 412 # Disabled until crbug.com/413829 is fixed. |
414 # self.AddUserStory(Page13(self)) | 413 # self.AddUserStory(Page13(self)) |
415 # Disabled because of crbug.com/413829 and flakiness crbug.com/368532 | 414 # Disabled because of crbug.com/413829 and flakiness crbug.com/368532 |
416 # self.AddUserStory(Page14(self)) | 415 # self.AddUserStory(Page14(self)) |
417 self.AddUserStory(Page15(self)) | 416 self.AddUserStory(Page15(self)) |
418 self.AddUserStory(Page16(self)) | 417 self.AddUserStory(Page16(self)) |
419 # Why: Test a requestAnimationFrame handler with concurrent CSS animation | 418 # Why: Test a requestAnimationFrame handler with concurrent CSS animation |
420 self.AddUserStory(ToughSchedulingCasesPage( | 419 self.AddUserStory(ToughSchedulingCasesPage( |
421 'file://tough_scheduling_cases/raf_animation.html', | 420 'file://tough_scheduling_cases/raf_animation.html', |
422 self)) | 421 self)) |
423 # Why: Stress test for the scheduler | 422 # Why: Stress test for the scheduler |
424 self.AddUserStory(ToughSchedulingCasesPage( | 423 self.AddUserStory(ToughSchedulingCasesPage( |
425 'file://tough_scheduling_cases/raf_touch_animation.html', | 424 'file://tough_scheduling_cases/raf_touch_animation.html', |
426 self)) | 425 self)) |
427 self.AddUserStory(Page17(self)) | 426 self.AddUserStory(Page17(self)) |
428 self.AddUserStory(Page18(self)) | 427 self.AddUserStory(Page18(self)) |
429 self.AddUserStory(Page19(self)) | 428 self.AddUserStory(Page19(self)) |
430 self.AddUserStory(Page20(self)) | 429 self.AddUserStory(Page20(self)) |
431 # Why: Baseline for scrolling in the presence of a no-op touch handler | 430 # Why: Baseline for scrolling in the presence of a no-op touch handler |
432 self.AddUserStory(EmptyTouchHandlerPage( | 431 self.AddUserStory(EmptyTouchHandlerPage( |
433 name='baseline', | 432 name='baseline', |
434 desktop=False, | 433 desktop=False, |
435 slow_handler=False, | 434 slow_handler=False, |
436 bounce=False, | 435 bounce=False, |
437 page_set=self)) | 436 page_set=self)) |
438 # Why: Slow handler blocks scroll start | 437 # Why: Slow handler blocks scroll start |
439 self.AddUserStory(EmptyTouchHandlerPage( | 438 self.AddUserStory(EmptyTouchHandlerPage( |
440 name='slow_handler', | 439 name='slow_handler', |
441 desktop=False, | 440 desktop=False, |
442 slow_handler=True, | 441 slow_handler=True, |
443 bounce=False, | 442 bounce=False, |
444 page_set=self)) | 443 page_set=self)) |
445 # Why: Slow handler blocks scroll start until touch ACK timeout | 444 # Why: Slow handler blocks scroll start until touch ACK timeout |
446 self.AddUserStory(EmptyTouchHandlerPage( | 445 self.AddUserStory(EmptyTouchHandlerPage( |
447 name='desktop_slow_handler', | 446 name='desktop_slow_handler', |
448 desktop=True, | 447 desktop=True, |
449 slow_handler=True, | 448 slow_handler=True, |
450 bounce=False, | 449 bounce=False, |
451 page_set=self)) | 450 page_set=self)) |
452 # Why: Scroll bounce showing repeated transitions between scrolling and | 451 # Why: Scroll bounce showing repeated transitions between scrolling and |
453 # sending synchronous touchmove events. Should be nearly as fast as | 452 # sending synchronous touchmove events. Should be nearly as fast as |
454 # scroll baseline. | 453 # scroll baseline. |
455 self.AddUserStory(EmptyTouchHandlerPage( | 454 self.AddUserStory(EmptyTouchHandlerPage( |
456 name='bounce', | 455 name='bounce', |
457 desktop=False, | 456 desktop=False, |
458 slow_handler=False, | 457 slow_handler=False, |
459 bounce=True, | 458 bounce=True, |
460 page_set=self)) | 459 page_set=self)) |
461 # Why: Scroll bounce with slow handler, repeated blocking. | 460 # Why: Scroll bounce with slow handler, repeated blocking. |
462 self.AddUserStory(EmptyTouchHandlerPage( | 461 self.AddUserStory(EmptyTouchHandlerPage( |
463 name='bounce_slow_handler', | 462 name='bounce_slow_handler', |
464 desktop=False, | 463 desktop=False, |
465 slow_handler=True, | 464 slow_handler=True, |
466 bounce=True, | 465 bounce=True, |
467 page_set=self)) | 466 page_set=self)) |
468 # Why: Scroll bounce with slow handler on desktop, blocks only once until | 467 # Why: Scroll bounce with slow handler on desktop, blocks only once until |
469 # ACK timeout. | 468 # ACK timeout. |
470 self.AddUserStory(EmptyTouchHandlerPage( | 469 self.AddUserStory(EmptyTouchHandlerPage( |
471 name='bounce_desktop_slow_handler', | 470 name='bounce_desktop_slow_handler', |
472 desktop=True, | 471 desktop=True, |
473 slow_handler=True, | 472 slow_handler=True, |
474 bounce=True, | 473 bounce=True, |
475 page_set=self)) | 474 page_set=self)) |
476 # Why: For measuring the latency of scroll-synchronized effects. | 475 # Why: For measuring the latency of scroll-synchronized effects. |
477 self.AddUserStory(SynchronizedScrollOffsetPage(page_set=self)) | 476 self.AddUserStory(SynchronizedScrollOffsetPage(page_set=self)) |
478 # Why: Good examples of poor initial scrolling | 477 # Why: Good examples of poor initial scrolling |
479 self.AddUserStory(ToughSchedulingCasesPage( | 478 self.AddUserStory(ToughSchedulingCasesPage( |
480 'http://www.latimes.com', | 479 'http://www.latimes.com', |
Sami
2015/01/27 15:30:37
Could you move latimes to the new page set too? It
picksi
2015/02/10 18:10:46
Done.
| |
481 self)) | 480 self)) |
482 self.AddUserStory(ToughSchedulingCasesPage( | |
483 'http://m.espn.go.com/nhl/rankings', | |
484 self)) | |
OLD | NEW |