| 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 shared_page_state | 5 from telemetry.page import shared_page_state |
| 6 from telemetry import story | 6 from telemetry import story |
| 7 | 7 |
| 8 | 8 |
| 9 class KeySilkCasesPage(page_module.Page): | 9 class KeySilkCasesPage(page_module.Page): |
| 10 | 10 |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 url='http://s.codepen.io/befamous/fullpage/pFsqb?scroll', | 553 url='http://s.codepen.io/befamous/fullpage/pFsqb?scroll', |
| 554 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 554 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
| 555 | 555 |
| 556 def RunNavigateSteps(self, action_runner): | 556 def RunNavigateSteps(self, action_runner): |
| 557 super(Page26, self).RunNavigateSteps(action_runner) | 557 super(Page26, self).RunNavigateSteps(action_runner) |
| 558 action_runner.WaitForJavaScriptCondition( | 558 action_runner.WaitForJavaScriptCondition( |
| 559 'document.getElementsByClassName("tweet").length > 0') | 559 'document.getElementsByClassName("tweet").length > 0') |
| 560 action_runner.Wait(1) | 560 action_runner.Wait(1) |
| 561 | 561 |
| 562 def PerformPageInteractions(self, action_runner): | 562 def PerformPageInteractions(self, action_runner): |
| 563 # Add a touch-action: none because this page prevent defaults all |
| 564 # touch moves. |
| 565 action_runner.ExecuteJavaScript(''' |
| 566 var style = document.createElement("style"); |
| 567 document.head.appendChild(style); |
| 568 style.sheet.insertRule("body { touch-action: none }", 0); |
| 569 ''') |
| 563 with action_runner.CreateGestureInteraction('ScrollAction'): | 570 with action_runner.CreateGestureInteraction('ScrollAction'): |
| 564 action_runner.ScrollPage(distance=5000) | 571 action_runner.ScrollPage(distance=5000) |
| 565 | 572 |
| 566 | 573 |
| 567 class SVGIconRaster(KeySilkCasesPage): | 574 class SVGIconRaster(KeySilkCasesPage): |
| 568 | 575 |
| 569 """ Why: Mutating SVG icons; these paint storm and paint slowly. """ | 576 """ Why: Mutating SVG icons; these paint storm and paint slowly. """ |
| 570 | 577 |
| 571 def __init__(self, page_set, run_no_page_interactions): | 578 def __init__(self, page_set, run_no_page_interactions): |
| 572 super(SVGIconRaster, self).__init__( | 579 super(SVGIconRaster, self).__init__( |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 self.AddStory(SilkFinance(self, run_no_page_interactions)) | 755 self.AddStory(SilkFinance(self, run_no_page_interactions)) |
| 749 # Flaky interaction steps on Android; crbug.com/507865 | 756 # Flaky interaction steps on Android; crbug.com/507865 |
| 750 # self.AddStory(PolymerTopeka(self, run_no_page_interactions)) | 757 # self.AddStory(PolymerTopeka(self, run_no_page_interactions)) |
| 751 self.AddStory(Masonry(self, run_no_page_interactions)) | 758 self.AddStory(Masonry(self, run_no_page_interactions)) |
| 752 | 759 |
| 753 for page in self: | 760 for page in self: |
| 754 assert (page.__class__.RunPageInteractions == | 761 assert (page.__class__.RunPageInteractions == |
| 755 KeySilkCasesPage.RunPageInteractions), ( | 762 KeySilkCasesPage.RunPageInteractions), ( |
| 756 'Pages in this page set must not override KeySilkCasesPage\' ' | 763 'Pages in this page set must not override KeySilkCasesPage\' ' |
| 757 'RunPageInteractions method.') | 764 'RunPageInteractions method.') |
| OLD | NEW |