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

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

Issue 2510443002: [System Health] Change scrolling behaviour for news sites. (Closed)
Patch Set: Created 4 years, 1 month 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 def _DidLoadDocument(self, action_runner): 70 def _DidLoadDocument(self, action_runner):
71 for i in xrange(self.ITEMS_TO_VISIT): 71 for i in xrange(self.ITEMS_TO_VISIT):
72 self._NavigateToItem(action_runner, i) 72 self._NavigateToItem(action_runner, i)
73 self._ReadNewsItem(action_runner) 73 self._ReadNewsItem(action_runner)
74 self._NavigateBack(action_runner) 74 self._NavigateBack(action_runner)
75 self._ScrollMainPage(action_runner) 75 self._ScrollMainPage(action_runner)
76 76
77 def _ReadNewsItem(self, action_runner): 77 def _ReadNewsItem(self, action_runner):
78 action_runner.tab.WaitForDocumentReadyStateToBeComplete() 78 action_runner.tab.WaitForDocumentReadyStateToBeComplete()
79 action_runner.Wait(self.ITEM_READ_TIME_IN_SECONDS) 79 action_runner.Wait(self.ITEM_READ_TIME_IN_SECONDS/2)
rnephew (Reviews Here) 2016/11/15 22:08:43 We could also have it wait the entire time before
perezju 2016/11/16 09:58:05 Note: This is doing integer division. So before it
80 action_runner.RepeatableBrowserDrivenScroll( 80 action_runner.RepeatableBrowserDrivenScroll(
81 repeat_count=self.ITEM_SCROLL_REPEAT) 81 repeat_count=self.ITEM_SCROLL_REPEAT)
82 action_runner.Wait(self.ITEM_READ_TIME_IN_SECONDS/2)
82 83
83 def _ScrollMainPage(self, action_runner): 84 def _ScrollMainPage(self, action_runner):
84 action_runner.tab.WaitForDocumentReadyStateToBeComplete() 85 action_runner.tab.WaitForDocumentReadyStateToBeComplete()
85 action_runner.RepeatableBrowserDrivenScroll( 86 action_runner.RepeatableBrowserDrivenScroll(
86 repeat_count=self.MAIN_PAGE_SCROLL_REPEAT) 87 repeat_count=self.MAIN_PAGE_SCROLL_REPEAT)
87 88
88 89
89 # TODO(ulan): Enable this story on mobile once it uses less memory and does not 90 # TODO(ulan): Enable this story on mobile once it uses less memory and does not
90 # crash with OOM. 91 # crash with OOM.
91 @decorators.Disabled('android', 92 @decorators.Disabled('android',
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 inner_save_function = 'document.querySelector(".nameAndIcons")' 366 inner_save_function = 'document.querySelector(".nameAndIcons")'
366 action_runner.WaitForElement(element_function=inner_save_function) 367 action_runner.WaitForElement(element_function=inner_save_function)
367 action_runner.ClickElement(element_function=inner_save_function) 368 action_runner.ClickElement(element_function=inner_save_function)
368 action_runner.Wait(1) # Wait to make navigation realistic. 369 action_runner.Wait(1) # Wait to make navigation realistic.
369 370
370 # Close selection. 371 # Close selection.
371 x_element_function = ('document.querySelector(' 372 x_element_function = ('document.querySelector('
372 '".Button.borderless.close.visible")') 373 '".Button.borderless.close.visible")')
373 action_runner.ClickElement(element_function=x_element_function) 374 action_runner.ClickElement(element_function=x_element_function)
374 action_runner.Wait(1) # Wait to make navigation realistic. 375 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