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

Side by Side Diff: tools/perf/page_sets/infinite_scroll_cases.py

Issue 1458083003: [Telemetry + tools/perf] Modify the pylint disable message to use symbolic name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « tools/perf/page_sets/google_pages.py ('k') | tools/perf/page_sets/intl_es_fr_pt-BR.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 7
8 TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS = 5 8 TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS = 5
9 9
10 # TODO(ulan): Remove this once crbug.com/541508 is fixed. 10 # TODO(ulan): Remove this once crbug.com/541508 is fixed.
(...skipping 13 matching lines...) Expand all
24 with action_runner.CreateInteraction('End'): 24 with action_runner.CreateInteraction('End'):
25 action_runner.tab.browser.DumpMemory() 25 action_runner.tab.browser.DumpMemory()
26 26
27 def _WaitAction(action_runner): 27 def _WaitAction(action_runner):
28 action_runner.WaitForJavaScriptCondition( 28 action_runner.WaitForJavaScriptCondition(
29 'document.body != null && ' 29 'document.body != null && '
30 'document.body.scrollHeight > window.innerHeight && ' 30 'document.body.scrollHeight > window.innerHeight && '
31 '!document.body.addEventListener("touchstart", function() {})') 31 '!document.body.addEventListener("touchstart", function() {})')
32 32
33 def _CreateInfiniteScrollPageClass(base_page_cls): 33 def _CreateInfiniteScrollPageClass(base_page_cls):
34 class DerivedSmoothPage(base_page_cls): # pylint: disable=W0232 34 class DerivedSmoothPage(base_page_cls): # pylint: disable=no-init
35 def RunPageInteractions(self, action_runner): 35 def RunPageInteractions(self, action_runner):
36 _WaitAction(action_runner) 36 _WaitAction(action_runner)
37 _ScrollAction(action_runner, self.scroll_amount) 37 _ScrollAction(action_runner, self.scroll_amount)
38 return DerivedSmoothPage 38 return DerivedSmoothPage
39 39
40 class InfiniteScrollPage(page_module.Page): 40 class InfiniteScrollPage(page_module.Page):
41 def __init__(self, url, page_set, name, scroll_amount, credentials=None): 41 def __init__(self, url, page_set, name, scroll_amount, credentials=None):
42 super(InfiniteScrollPage, self).__init__( 42 super(InfiniteScrollPage, self).__init__(
43 url=url, page_set=page_set, name=name, 43 url=url, page_set=page_set, name=name,
44 shared_page_state_class=shared_page_state.SharedPageState, 44 shared_page_state_class=shared_page_state.SharedPageState,
(...skipping 16 matching lines...) Expand all
61 ('https://www.facebook.com/shakira', 'facebook', SCROLL_FAR), 61 ('https://www.facebook.com/shakira', 'facebook', SCROLL_FAR),
62 ('https://twitter.com/taylorswift13', 'twitter', SCROLL_FAR), 62 ('https://twitter.com/taylorswift13', 'twitter', SCROLL_FAR),
63 ('http://espn.go.com/', 'espn', SCROLL_NEAR), 63 ('http://espn.go.com/', 'espn', SCROLL_NEAR),
64 ('https://www.yahoo.com', 'yahoo', SCROLL_NEAR), 64 ('https://www.yahoo.com', 'yahoo', SCROLL_NEAR),
65 ('http://techcrunch.tumblr.com/', 'tumblr', SCROLL_FAR), 65 ('http://techcrunch.tumblr.com/', 'tumblr', SCROLL_FAR),
66 ('https://www.flickr.com/explore', 'flickr', SCROLL_FAR) 66 ('https://www.flickr.com/explore', 'flickr', SCROLL_FAR)
67 ] 67 ]
68 for (url, name, scroll_amount) in pages: 68 for (url, name, scroll_amount) in pages:
69 page_class = _CreateInfiniteScrollPageClass(InfiniteScrollPage) 69 page_class = _CreateInfiniteScrollPageClass(InfiniteScrollPage)
70 self.AddStory(page_class(url, self, name, scroll_amount)) 70 self.AddStory(page_class(url, self, name, scroll_amount))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/google_pages.py ('k') | tools/perf/page_sets/intl_es_fr_pt-BR.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698