| 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 from telemetry.util import js_template | 7 from telemetry.util import js_template |
| 8 | 8 |
| 9 | 9 |
| 10 class PolymerPage(page_module.Page): | 10 class PolymerPage(page_module.Page): |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 # only bother with this interaction if the drawer is hidden | 72 # only bother with this interaction if the drawer is hidden |
| 73 opened = action_runner.EvaluateJavaScript(''' | 73 opened = action_runner.EvaluateJavaScript(''' |
| 74 (function() { | 74 (function() { |
| 75 var outer = document.querySelector("body /deep/ #outerPanels"); | 75 var outer = document.querySelector("body /deep/ #outerPanels"); |
| 76 return outer.opened || outer.wideMode; | 76 return outer.opened || outer.wideMode; |
| 77 }());''') | 77 }());''') |
| 78 if not opened: | 78 if not opened: |
| 79 with action_runner.CreateInteraction('PolymerAnimation', repeatable=True): | 79 with action_runner.CreateInteraction('PolymerAnimation', repeatable=True): |
| 80 action_runner.SwipeElement( | 80 action_runner.SwipeElement( |
| 81 left_start_ratio=0.1, top_start_ratio=0.2, | 81 left_start_ratio=0.1, top_start_ratio=0.2, |
| 82 direction='left', distance=300, speed_in_pixels_per_second=5000, | 82 direction='right', distance=300, speed_in_pixels_per_second=5000, |
| 83 element_function=''' | 83 element_function=''' |
| 84 document.querySelector( | 84 document.querySelector( |
| 85 'body /deep/ #outerPanels' | 85 'body /deep/ #outerPanels' |
| 86 ).querySelector( | 86 ).querySelector( |
| 87 '#advanced' | 87 '#advanced' |
| 88 ).shadowRoot.querySelector( | 88 ).shadowRoot.querySelector( |
| 89 '.handle-bar' | 89 '.handle-bar' |
| 90 )''') | 90 )''') |
| 91 action_runner.WaitForJavaScriptCondition(''' | 91 action_runner.WaitForJavaScriptCondition(''' |
| 92 var outer = document.querySelector("body /deep/ #outerPanels"); | 92 var outer = document.querySelector("body /deep/ #outerPanels"); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 for p in SCROLLABLE_PAGES: | 253 for p in SCROLLABLE_PAGES: |
| 254 self.AddStory(PolymerSampler( | 254 self.AddStory(PolymerSampler( |
| 255 self, p, run_no_page_interactions=run_no_page_interactions, | 255 self, p, run_no_page_interactions=run_no_page_interactions, |
| 256 scrolling_page=True)) | 256 scrolling_page=True)) |
| 257 | 257 |
| 258 for page in self: | 258 for page in self: |
| 259 assert (page.__class__.RunPageInteractions == | 259 assert (page.__class__.RunPageInteractions == |
| 260 PolymerPage.RunPageInteractions), ( | 260 PolymerPage.RunPageInteractions), ( |
| 261 'Pages in this page set must not override PolymerPage\' ' | 261 'Pages in this page set must not override PolymerPage\' ' |
| 262 'RunPageInteractions method.') | 262 'RunPageInteractions method.') |
| OLD | NEW |