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 KeySilkCasesPage(page_module.Page): | 8 class KeySilkCasesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set, run_no_page_interactions): | 10 def __init__(self, url, page_set, run_no_page_interactions): |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 def __init__(self, page_set, run_no_page_interactions): | 313 def __init__(self, page_set, run_no_page_interactions): |
314 super(Page17, self).__init__( | 314 super(Page17, self).__init__( |
315 url='file://key_silk_cases/inbox_app.html?stress_hidey_bars', | 315 url='file://key_silk_cases/inbox_app.html?stress_hidey_bars', |
316 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 316 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
317 | 317 |
318 def PerformPageInteractions(self, action_runner): | 318 def PerformPageInteractions(self, action_runner): |
319 self.StressHideyBars(action_runner) | 319 self.StressHideyBars(action_runner) |
320 | 320 |
321 def StressHideyBars(self, action_runner): | 321 def StressHideyBars(self, action_runner): |
322 with action_runner.CreateGestureInteraction('ScrollAction'): | 322 with action_runner.CreateGestureInteraction( |
| 323 'ScrollAction', repeatable=True): |
323 action_runner.ScrollElement( | 324 action_runner.ScrollElement( |
324 selector='#messages', direction='down', speed_in_pixels_per_second=200) | 325 selector='#messages', direction='down', speed_in_pixels_per_second=200) |
325 with action_runner.CreateGestureInteraction('ScrollAction'): | 326 with action_runner.CreateGestureInteraction( |
| 327 'ScrollAction', repeatable=True): |
326 action_runner.ScrollElement( | 328 action_runner.ScrollElement( |
327 selector='#messages', direction='up', speed_in_pixels_per_second=200) | 329 selector='#messages', direction='up', speed_in_pixels_per_second=200) |
328 with action_runner.CreateGestureInteraction('ScrollAction'): | 330 with action_runner.CreateGestureInteraction( |
| 331 'ScrollAction', repeatable=True): |
329 action_runner.ScrollElement( | 332 action_runner.ScrollElement( |
330 selector='#messages', direction='down', | 333 selector='#messages', direction='down', |
331 speed_in_pixels_per_second=200) | 334 speed_in_pixels_per_second=200) |
332 | 335 |
333 | 336 |
334 class Page18(KeySilkCasesPage): | 337 class Page18(KeySilkCasesPage): |
335 | 338 |
336 def __init__(self, page_set, run_no_page_interactions): | 339 def __init__(self, page_set, run_no_page_interactions): |
337 super(Page18, self).__init__( | 340 super(Page18, self).__init__( |
338 url='file://key_silk_cases/inbox_app.html?toggle_drawer', | 341 url='file://key_silk_cases/inbox_app.html?toggle_drawer', |
339 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 342 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
340 | 343 |
341 def PerformPageInteractions(self, action_runner): | 344 def PerformPageInteractions(self, action_runner): |
342 for _ in xrange(6): | 345 for _ in xrange(6): |
343 self.ToggleDrawer(action_runner) | 346 self.ToggleDrawer(action_runner) |
344 | 347 |
345 def ToggleDrawer(self, action_runner): | 348 def ToggleDrawer(self, action_runner): |
346 with action_runner.CreateInteraction('Action_TapAction'): | 349 with action_runner.CreateInteraction('Action_TapAction', repeatable=True): |
347 action_runner.TapElement('#menu-button') | 350 action_runner.TapElement('#menu-button') |
348 action_runner.Wait(1) | 351 action_runner.Wait(1) |
349 | 352 |
350 | 353 |
351 class Page19(KeySilkCasesPage): | 354 class Page19(KeySilkCasesPage): |
352 | 355 |
353 def __init__(self, page_set, run_no_page_interactions): | 356 def __init__(self, page_set, run_no_page_interactions): |
354 super(Page19, self).__init__( | 357 super(Page19, self).__init__( |
355 url='file://key_silk_cases/inbox_app.html?slide_drawer', | 358 url='file://key_silk_cases/inbox_app.html?slide_drawer', |
356 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 359 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 super(Page23, self).__init__( | 483 super(Page23, self).__init__( |
481 url='http://jsbin.com/UVIgUTa/38/quiet', | 484 url='http://jsbin.com/UVIgUTa/38/quiet', |
482 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 485 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
483 | 486 |
484 def PerformPageInteractions(self, action_runner): | 487 def PerformPageInteractions(self, action_runner): |
485 with action_runner.CreateGestureInteraction('ScrollAction'): | 488 with action_runner.CreateGestureInteraction('ScrollAction'): |
486 action_runner.ScrollPage( | 489 action_runner.ScrollPage( |
487 distance_expr='window.innerHeight / 2', | 490 distance_expr='window.innerHeight / 2', |
488 direction='down', | 491 direction='down', |
489 use_touch=True) | 492 use_touch=True) |
490 with action_runner.CreateInteraction('Wait'): | |
491 action_runner.Wait(1) | 493 action_runner.Wait(1) |
492 | 494 |
493 | 495 |
494 class Page24(KeySilkCasesPage): | 496 class Page24(KeySilkCasesPage): |
495 | 497 |
496 """ | 498 """ |
497 Why: Google News: this iOS version is slower than accelerated scrolling | 499 Why: Google News: this iOS version is slower than accelerated scrolling |
498 """ | 500 """ |
499 | 501 |
500 def __init__(self, page_set, run_no_page_interactions): | 502 def __init__(self, page_set, run_no_page_interactions): |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions)) | 744 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions)) |
743 self.AddUserStory(SilkFinance(self, run_no_page_interactions)) | 745 self.AddUserStory(SilkFinance(self, run_no_page_interactions)) |
744 self.AddUserStory(PolymerTopeka(self, run_no_page_interactions)) | 746 self.AddUserStory(PolymerTopeka(self, run_no_page_interactions)) |
745 self.AddUserStory(Masonry(self, run_no_page_interactions)) | 747 self.AddUserStory(Masonry(self, run_no_page_interactions)) |
746 | 748 |
747 for page in self: | 749 for page in self: |
748 assert (page.__class__.RunPageInteractions == | 750 assert (page.__class__.RunPageInteractions == |
749 KeySilkCasesPage.RunPageInteractions), ( | 751 KeySilkCasesPage.RunPageInteractions), ( |
750 'Pages in this page set must not override KeySilkCasesPage\' ' | 752 'Pages in this page set must not override KeySilkCasesPage\' ' |
751 'RunPageInteractions method.') | 753 'RunPageInteractions method.') |
OLD | NEW |