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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 Why: Physical simulation demo that does a lot of element.style mutation | 478 Why: Physical simulation demo that does a lot of element.style mutation |
476 triggering JS and recalc slowness | 479 triggering JS and recalc slowness |
477 """ | 480 """ |
478 | 481 |
479 def __init__(self, page_set, run_no_page_interactions): | 482 def __init__(self, page_set, run_no_page_interactions): |
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', |
| 489 repeatable=True): |
486 action_runner.ScrollPage( | 490 action_runner.ScrollPage( |
487 distance_expr='window.innerHeight / 2', | 491 distance_expr='window.innerHeight / 2', |
488 direction='down', | 492 direction='down', |
489 use_touch=True) | 493 use_touch=True) |
490 with action_runner.CreateInteraction('Wait'): | 494 with action_runner.CreateGestureInteraction('ScrollAction', |
| 495 repeatable=True): |
491 action_runner.Wait(1) | 496 action_runner.Wait(1) |
492 | 497 |
493 | 498 |
494 class Page24(KeySilkCasesPage): | 499 class Page24(KeySilkCasesPage): |
495 | 500 |
496 """ | 501 """ |
497 Why: Google News: this iOS version is slower than accelerated scrolling | 502 Why: Google News: this iOS version is slower than accelerated scrolling |
498 """ | 503 """ |
499 | 504 |
500 def __init__(self, page_set, run_no_page_interactions): | 505 def __init__(self, page_set, run_no_page_interactions): |
(...skipping 22 matching lines...) Expand all Loading... |
523 url='http://mobile-news.sandbox.google.com/news/pt0?swipe', | 528 url='http://mobile-news.sandbox.google.com/news/pt0?swipe', |
524 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 529 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
525 | 530 |
526 def RunNavigateSteps(self, action_runner): | 531 def RunNavigateSteps(self, action_runner): |
527 super(Page25, self).RunNavigateSteps(action_runner) | 532 super(Page25, self).RunNavigateSteps(action_runner) |
528 action_runner.WaitForJavaScriptCondition( | 533 action_runner.WaitForJavaScriptCondition( |
529 'document.getElementById(":h") != null') | 534 'document.getElementById(":h") != null') |
530 action_runner.Wait(1) | 535 action_runner.Wait(1) |
531 | 536 |
532 def PerformPageInteractions(self, action_runner): | 537 def PerformPageInteractions(self, action_runner): |
533 with action_runner.CreateGestureInteraction('SwipeAction'): | 538 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): |
534 action_runner.SwipeElement( | 539 action_runner.SwipeElement( |
535 direction='left', distance=100, | 540 direction='left', distance=100, |
536 element_function='document.getElementById(":f")') | 541 element_function='document.getElementById(":f")') |
537 with action_runner.CreateInteraction('Wait'): | 542 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): |
538 action_runner.Wait(1) | 543 action_runner.Wait(1) |
539 | 544 |
540 | 545 |
541 class Page26(KeySilkCasesPage): | 546 class Page26(KeySilkCasesPage): |
542 | 547 |
543 """ Why: famo.us twitter demo """ | 548 """ Why: famo.us twitter demo """ |
544 | 549 |
545 def __init__(self, page_set, run_no_page_interactions): | 550 def __init__(self, page_set, run_no_page_interactions): |
546 super(Page26, self).__init__( | 551 super(Page26, self).__init__( |
547 url='http://s.codepen.io/befamous/fullpage/pFsqb?scroll', | 552 url='http://s.codepen.io/befamous/fullpage/pFsqb?scroll', |
(...skipping 22 matching lines...) Expand all Loading... |
570 def RunNavigateSteps(self, action_runner): | 575 def RunNavigateSteps(self, action_runner): |
571 super(SVGIconRaster, self).RunNavigateSteps(action_runner) | 576 super(SVGIconRaster, self).RunNavigateSteps(action_runner) |
572 action_runner.WaitForJavaScriptCondition( | 577 action_runner.WaitForJavaScriptCondition( |
573 'loaded = true') | 578 'loaded = true') |
574 action_runner.Wait(1) | 579 action_runner.Wait(1) |
575 | 580 |
576 def PerformPageInteractions(self, action_runner): | 581 def PerformPageInteractions(self, action_runner): |
577 for i in xrange(9): | 582 for i in xrange(9): |
578 button_func = ('document.getElementById("demo").$.' | 583 button_func = ('document.getElementById("demo").$.' |
579 'buttons.children[%d]') % i | 584 'buttons.children[%d]') % i |
580 with action_runner.CreateInteraction('Action_TapAction'): | 585 with action_runner.CreateInteraction('Action_TapAction', repeatable=True): |
581 action_runner.TapElement(element_function=button_func) | 586 action_runner.TapElement(element_function=button_func) |
582 action_runner.Wait(1) | 587 action_runner.Wait(1) |
583 | 588 |
584 | 589 |
585 class UpdateHistoryState(KeySilkCasesPage): | 590 class UpdateHistoryState(KeySilkCasesPage): |
586 | 591 |
587 """ Why: Modern apps often update history state, which currently is janky.""" | 592 """ Why: Modern apps often update history state, which currently is janky.""" |
588 | 593 |
589 def __init__(self, page_set, run_no_page_interactions): | 594 def __init__(self, page_set, run_no_page_interactions): |
590 super(UpdateHistoryState, self).__init__( | 595 super(UpdateHistoryState, self).__init__( |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions)) | 747 self.AddUserStory(UpdateHistoryState(self, run_no_page_interactions)) |
743 self.AddUserStory(SilkFinance(self, run_no_page_interactions)) | 748 self.AddUserStory(SilkFinance(self, run_no_page_interactions)) |
744 self.AddUserStory(PolymerTopeka(self, run_no_page_interactions)) | 749 self.AddUserStory(PolymerTopeka(self, run_no_page_interactions)) |
745 self.AddUserStory(Masonry(self, run_no_page_interactions)) | 750 self.AddUserStory(Masonry(self, run_no_page_interactions)) |
746 | 751 |
747 for page in self: | 752 for page in self: |
748 assert (page.__class__.RunPageInteractions == | 753 assert (page.__class__.RunPageInteractions == |
749 KeySilkCasesPage.RunPageInteractions), ( | 754 KeySilkCasesPage.RunPageInteractions), ( |
750 'Pages in this page set must not override KeySilkCasesPage\' ' | 755 'Pages in this page set must not override KeySilkCasesPage\' ' |
751 'RunPageInteractions method.') | 756 'RunPageInteractions method.') |
OLD | NEW |