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

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

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « tools/perf/page_sets/maps.py ('k') | tools/perf/page_sets/mobile_memory.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 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 from page_sets import mobile_facebook_page 4 from page_sets import mobile_facebook_page
5 from telemetry.page import page as page_module 5 from telemetry.page import page as page_module
6 from telemetry.page import shared_page_state 6 from telemetry.page import shared_page_state
7 from telemetry import story 7 from telemetry import story
8 8
9 TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS = 5 9 TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS = 5
10 SCROLL_TIMEOUT_IN_SECONDS = 120 10 SCROLL_TIMEOUT_IN_SECONDS = 120
(...skipping 11 matching lines...) Expand all
22 action_runner.RepeatableBrowserDrivenScroll( 22 action_runner.RepeatableBrowserDrivenScroll(
23 y_scroll_distance_ratio=scroll_amount, 23 y_scroll_distance_ratio=scroll_amount,
24 repeat_delay_ms=delay, 24 repeat_delay_ms=delay,
25 repeat_count=repeat, 25 repeat_count=repeat,
26 timeout=SCROLL_TIMEOUT_IN_SECONDS) 26 timeout=SCROLL_TIMEOUT_IN_SECONDS)
27 with action_runner.CreateInteraction('End'): 27 with action_runner.CreateInteraction('End'):
28 action_runner.tab.browser.DumpMemory() 28 action_runner.tab.browser.DumpMemory()
29 29
30 def _WaitAction(action_runner): 30 def _WaitAction(action_runner):
31 with action_runner.CreateInteraction('Load'): 31 with action_runner.CreateInteraction('Load'):
32 action_runner.WaitForJavaScriptCondition2( 32 action_runner.WaitForJavaScriptCondition(
33 'document.body != null && ' 33 'document.body != null && '
34 'document.body.scrollHeight > window.innerHeight && ' 34 'document.body.scrollHeight > window.innerHeight && '
35 '!document.body.addEventListener("touchstart", function() {})') 35 '!document.body.addEventListener("touchstart", function() {})')
36 with action_runner.CreateInteraction('Wait'): 36 with action_runner.CreateInteraction('Wait'):
37 action_runner.Wait(TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS) 37 action_runner.Wait(TIME_TO_WAIT_BEFORE_STARTING_IN_SECONDS)
38 with action_runner.CreateInteraction('GC'): 38 with action_runner.CreateInteraction('GC'):
39 action_runner.ForceGarbageCollection() 39 action_runner.ForceGarbageCollection()
40 40
41 class MobileInfiniteScrollPage(page_module.Page): 41 class MobileInfiniteScrollPage(page_module.Page):
42 def __init__(self, url, page_set, name, scroll_amount, delay, repeat, 42 def __init__(self, url, page_set, name, scroll_amount, delay, repeat,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ('https://www.flickr.com/explore', 'flickr', SCROLL_FAR, 0, 0), 89 ('https://www.flickr.com/explore', 'flickr', SCROLL_FAR, 0, 0),
90 ('https://meta.discourse.org/t/the-official-discourse-tags-plugin-discou rse-tagging/26482', 90 ('https://meta.discourse.org/t/the-official-discourse-tags-plugin-discou rse-tagging/26482',
91 'discourse', SCROLL_PAGE, 10, 30) 91 'discourse', SCROLL_PAGE, 10, 30)
92 ] 92 ]
93 self.AddStory( 93 self.AddStory(
94 MobileInfiniteScrollFacebookPage(pages[0][0], self, pages[0][1], 94 MobileInfiniteScrollFacebookPage(pages[0][0], self, pages[0][1],
95 pages[0][2], pages[0][3], pages[0][4])) 95 pages[0][2], pages[0][3], pages[0][4]))
96 for (url, name, scroll_amount, delay, repeat) in pages[1:]: 96 for (url, name, scroll_amount, delay, repeat) in pages[1:]:
97 self.AddStory( 97 self.AddStory(
98 MobileInfiniteScrollPage(url, self, name, scroll_amount, delay, repeat)) 98 MobileInfiniteScrollPage(url, self, name, scroll_amount, delay, repeat))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/maps.py ('k') | tools/perf/page_sets/mobile_memory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698