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 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class KeySilkCasesPage(page_module.Page): | 10 class KeySilkCasesPage(page_module.Page): |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 'document.getElementsByClassName("tweet").length > 0') | 557 'document.getElementsByClassName("tweet").length > 0') |
558 action_runner.Wait(1) | 558 action_runner.Wait(1) |
559 | 559 |
560 def RunSmoothness(self, action_runner): | 560 def RunSmoothness(self, action_runner): |
561 interaction = action_runner.BeginGestureInteraction( | 561 interaction = action_runner.BeginGestureInteraction( |
562 'ScrollAction', is_smooth=True) | 562 'ScrollAction', is_smooth=True) |
563 action_runner.ScrollPage(distance=5000) | 563 action_runner.ScrollPage(distance=5000) |
564 interaction.End() | 564 interaction.End() |
565 | 565 |
566 | 566 |
| 567 class SVGIconRaster(KeySilkCasesPage): |
| 568 |
| 569 """ Why: Mutating SVG icons; these paint storm and paint slowly. """ |
| 570 |
| 571 def __init__(self, page_set): |
| 572 super(SVGIconRaster, self).__init__( |
| 573 url='http://wiltzius.github.io/shape-shifter/', |
| 574 page_set=page_set) |
| 575 |
| 576 def RunNavigateSteps(self, action_runner): |
| 577 action_runner.NavigateToPage(self) |
| 578 action_runner.WaitForJavaScriptCondition( |
| 579 'loaded = true') |
| 580 action_runner.Wait(1) |
| 581 |
| 582 def RunSmoothness(self, action_runner): |
| 583 for i in xrange(9): |
| 584 button_func = ('document.getElementById("demo").$.' |
| 585 'buttons.children[%d]') % i |
| 586 interaction = action_runner.BeginInteraction( |
| 587 'Action_TapAction', is_smooth=True) |
| 588 action_runner.TapElement(element_function=button_func) |
| 589 action_runner.Wait(1) |
| 590 interaction.End() |
| 591 |
567 class KeySilkCasesPageSet(page_set_module.PageSet): | 592 class KeySilkCasesPageSet(page_set_module.PageSet): |
568 | 593 |
569 """ Pages hand-picked for project Silk. """ | 594 """ Pages hand-picked for project Silk. """ |
570 | 595 |
571 def __init__(self): | 596 def __init__(self): |
572 super(KeySilkCasesPageSet, self).__init__( | 597 super(KeySilkCasesPageSet, self).__init__( |
573 credentials_path='data/credentials.json', | 598 credentials_path='data/credentials.json', |
574 user_agent_type='mobile', | 599 user_agent_type='mobile', |
575 archive_data_file='data/key_silk_cases.json', | 600 archive_data_file='data/key_silk_cases.json', |
576 bucket=page_set_module.PARTNER_BUCKET) | 601 bucket=page_set_module.PARTNER_BUCKET) |
(...skipping 17 matching lines...) Expand all Loading... |
594 self.AddPage(Page17(self)) | 619 self.AddPage(Page17(self)) |
595 self.AddPage(Page18(self)) | 620 self.AddPage(Page18(self)) |
596 self.AddPage(Page19(self)) | 621 self.AddPage(Page19(self)) |
597 self.AddPage(Page20(self)) | 622 self.AddPage(Page20(self)) |
598 self.AddPage(Page21(self)) | 623 self.AddPage(Page21(self)) |
599 self.AddPage(Page22(self)) | 624 self.AddPage(Page22(self)) |
600 self.AddPage(Page23(self)) | 625 self.AddPage(Page23(self)) |
601 self.AddPage(Page24(self)) | 626 self.AddPage(Page24(self)) |
602 self.AddPage(Page25(self)) | 627 self.AddPage(Page25(self)) |
603 self.AddPage(Page26(self)) | 628 self.AddPage(Page26(self)) |
| 629 self.AddPage(SVGIconRaster(self)) |
OLD | NEW |