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

Unified Diff: tools/perf/page_sets/system_health/browsing_stories.py

Issue 2414153004: [System Health] Make pinterest/tumblr stories scroll to elements off screen. (Closed)
Patch Set: Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/system_health/browsing_stories.py
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py
index 955997ccb7d68e35c1b98c39a68fa10322bbeb99..6d0cc817ebd8a02addd1426f1792beea11777014 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -29,6 +29,8 @@ class _BrowsingStory(system_health_story.SystemHealthStory):
def _NavigateToItem(self, action_runner, index):
item_selector = 'document.querySelectorAll("%s")[%d]' % (
self.ITEM_SELECTOR, index)
+ # Only scrolls if element is not currently in viewport.
+ action_runner.ScrollPageToElement(element_function=item_selector)
self._ClickLink(action_runner, item_selector)
def _ClickLink(self, action_runner, element_function):
@@ -315,22 +317,22 @@ class TumblrDesktopStory(_MediaBrowsingStory):
URL = 'https://tumblr.com/search/gifs'
ITEM_SELECTOR = '.photo'
IS_SINGLE_PAGE_APP = True
- ITEMS_TO_VISIT = 2 # Increase when crbug.com/651909 is implemented.
+ ITEMS_TO_VISIT = 8
rnephew (Reviews Here) 2016/10/14 22:52:52 Should I just use the default 15 here?
petrcermak 2016/10/17 08:51:37 Unless it makes the story too long or less stable,
rnephew (Reviews Here) 2016/10/17 18:48:19 After some local experimenting it does seem to mak
ITEM_VIEW_TIME_IN_SECONDS = 5
INCREMENT_INDEX_AFTER_EACH_ITEM = True
- SUPPORTED_PLATFORMS = platforms.NO_PLATFORMS # crbug.com/651909.
+ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
def _ViewMediaItem(self, action_runner, index):
super(TumblrDesktopStory, self)._ViewMediaItem(action_runner, index)
action_runner.MouseClick(selector='#tumblr_lightbox_center_image')
-
+ action_runner.Wait(1) # To make browsing more realistic.
petrcermak 2016/10/17 08:51:37 nit: There should be two spaces before a comment.
rnephew (Reviews Here) 2016/10/17 18:48:19 Done.
class PinterestDesktopStory(_MediaBrowsingStory):
NAME = 'browse:media:pinterest'
URL = 'https://pinterest.com'
ITEM_SELECTOR = '.pinImageDim'
IS_SINGLE_PAGE_APP = True
- ITEMS_TO_VISIT = 5 # Increase when crbug.com/651909 is implemented.
+ ITEMS_TO_VISIT = 8
ITEM_VIEW_TIME_IN_SECONDS = 5
INCREMENT_INDEX_AFTER_EACH_ITEM = True
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
« 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