Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Side by Side Diff: tools/perf/page_sets/system_health/browsing_stories.py

Issue 2549093003: [tools/perf] Refactor NavigateBack implementation to use action_runner.NavigateBack (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698