| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 4 |
| 5 from page_sets.system_health import platforms | 5 from page_sets.system_health import platforms |
| 6 from page_sets.system_health import system_health_story | 6 from page_sets.system_health import system_health_story |
| 7 | 7 |
| 8 from page_sets.login_helpers import pinterest_login | 8 from page_sets.login_helpers import pinterest_login |
| 9 | 9 |
| 10 from telemetry import decorators | 10 from telemetry import decorators |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 action_runner.WaitForElement(element_function=item_selector) | 33 action_runner.WaitForElement(element_function=item_selector) |
| 34 action_runner.ScrollPageToElement(element_function=item_selector) | 34 action_runner.ScrollPageToElement(element_function=item_selector) |
| 35 self._ClickLink(action_runner, item_selector) | 35 self._ClickLink(action_runner, item_selector) |
| 36 | 36 |
| 37 def _ClickLink(self, action_runner, element_function): | 37 def _ClickLink(self, action_runner, element_function): |
| 38 action_runner.WaitForElement(element_function=element_function) | 38 action_runner.WaitForElement(element_function=element_function) |
| 39 action_runner.ClickElement(element_function=element_function) | 39 action_runner.ClickElement(element_function=element_function) |
| 40 self._WaitForNavigation(action_runner) | 40 self._WaitForNavigation(action_runner) |
| 41 | 41 |
| 42 def _NavigateBack(self, action_runner): | 42 def _NavigateBack(self, action_runner): |
| 43 action_runner.ExecuteJavaScript('window.history.back()') | 43 action_runner.NavigateBack() |
| 44 self._WaitForNavigation(action_runner) | 44 self._WaitForNavigation(action_runner) |
| 45 | 45 |
| 46 | 46 |
| 47 ############################################################################## | 47 ############################################################################## |
| 48 # News browsing stories. | 48 # News browsing stories. |
| 49 ############################################################################## | 49 ############################################################################## |
| 50 | 50 |
| 51 | 51 |
| 52 class _NewsBrowsingStory(_BrowsingStory): | 52 class _NewsBrowsingStory(_BrowsingStory): |
| 53 """Abstract base class for news user stories. | 53 """Abstract base class for news user stories. |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 inner_save_function = 'document.querySelector(".nameAndIcons")' | 370 inner_save_function = 'document.querySelector(".nameAndIcons")' |
| 371 action_runner.WaitForElement(element_function=inner_save_function) | 371 action_runner.WaitForElement(element_function=inner_save_function) |
| 372 action_runner.ClickElement(element_function=inner_save_function) | 372 action_runner.ClickElement(element_function=inner_save_function) |
| 373 action_runner.Wait(1) # Wait to make navigation realistic. | 373 action_runner.Wait(1) # Wait to make navigation realistic. |
| 374 | 374 |
| 375 # Close selection. | 375 # Close selection. |
| 376 x_element_function = ('document.querySelector(' | 376 x_element_function = ('document.querySelector(' |
| 377 '".Button.borderless.close.visible")') | 377 '".Button.borderless.close.visible")') |
| 378 action_runner.ClickElement(element_function=x_element_function) | 378 action_runner.ClickElement(element_function=x_element_function) |
| 379 action_runner.Wait(1) # Wait to make navigation realistic. | 379 action_runner.Wait(1) # Wait to make navigation realistic. |
| OLD | NEW |