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

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

Issue 1198823004: Update perf page_set to use story_set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 shared_page_state
5 from telemetry.page import page as page_module
6 from telemetry.page import page_set as page_set_module
7
8 from page_sets import key_mobile_sites_pages 4 from page_sets import key_mobile_sites_pages
9 from page_sets import repaint_helpers 5 from page_sets import repaint_helpers
10 6 from telemetry import story
7 from telemetry.page import page as page_module
8 from telemetry.page import shared_page_state
11 9
12 10
13 def _CreatePageClassWithRepaintInteractions(page_cls, mode, height, width): 11 def _CreatePageClassWithRepaintInteractions(page_cls, mode, height, width):
14 class DerivedRepaintPage(page_cls): # pylint: disable=W0232 12 class DerivedRepaintPage(page_cls): # pylint: disable=W0232
15 13
16 def RunPageInteractions(self, action_runner): 14 def RunPageInteractions(self, action_runner):
17 repaint_helpers.Repaint( 15 repaint_helpers.Repaint(
18 action_runner, mode=mode, width=width, height=height) 16 action_runner, mode=mode, width=width, height=height)
19 17
20 return DerivedRepaintPage 18 return DerivedRepaintPage
21 19
22 20
23 class KeyMobileSitesRepaintPage(page_module.Page): 21 class KeyMobileSitesRepaintPage(page_module.Page):
24 22
25 def __init__(self, url, page_set, mode, height, width, name='', labels=None): 23 def __init__(self, url, page_set, mode, height, width, name='', labels=None):
26 super(KeyMobileSitesRepaintPage, self).__init__( 24 super(KeyMobileSitesRepaintPage, self).__init__(
27 url=url, page_set=page_set, name=name, 25 url=url, page_set=page_set, name=name,
28 shared_page_state_class=shared_page_state.SharedMobilePageState, 26 shared_page_state_class=shared_page_state.SharedMobilePageState,
29 credentials_path='data/credentials.json', labels=labels) 27 credentials_path='data/credentials.json', labels=labels)
30 self.archive_data_file = 'data/key_mobile_sites_repaint.json' 28 self.archive_data_file = 'data/key_mobile_sites_repaint.json'
31 self._mode = mode 29 self._mode = mode
32 self._width = width 30 self._width = width
33 self._height = height 31 self._height = height
34 32
35 def RunPageInteractions(self, action_runner): 33 def RunPageInteractions(self, action_runner):
36 repaint_helpers.Repaint( 34 repaint_helpers.Repaint(
37 action_runner, mode=self._mode, width=self._width, height=self._height) 35 action_runner, mode=self._mode, width=self._width, height=self._height)
38 36
39 37
40 class KeyMobileSitesRepaintPageSet(page_set_module.PageSet): 38 class KeyMobileSitesRepaintPageSet(story.StorySet):
41 39
42 """ Key mobile sites with repaint interactions. """ 40 """ Key mobile sites with repaint interactions. """
43 41
44 def __init__(self, mode='viewport', width=None, height=None): 42 def __init__(self, mode='viewport', width=None, height=None):
45 super(KeyMobileSitesRepaintPageSet, self).__init__( 43 super(KeyMobileSitesRepaintPageSet, self).__init__(
46 archive_data_file='data/key_mobile_sites_repaint.json', 44 archive_data_file='data/key_mobile_sites_repaint.json',
47 bucket=page_set_module.PARTNER_BUCKET) 45 cloud_storage_bucket=story.PARTNER_BUCKET)
48 46
49 47
50 # Add pages with predefined classes that contain custom navigation logic. 48 # Add pages with predefined classes that contain custom navigation logic.
51 predefined_page_classes = [ 49 predefined_page_classes = [
52 key_mobile_sites_pages.CapitolVolkswagenPage, 50 key_mobile_sites_pages.CapitolVolkswagenPage,
53 key_mobile_sites_pages.TheVergeArticlePage, 51 key_mobile_sites_pages.TheVergeArticlePage,
54 key_mobile_sites_pages.CnnArticlePage, 52 key_mobile_sites_pages.CnnArticlePage,
55 key_mobile_sites_pages.FacebookPage, 53 key_mobile_sites_pages.FacebookPage,
56 key_mobile_sites_pages.YoutubeMobilePage, 54 key_mobile_sites_pages.YoutubeMobilePage,
57 key_mobile_sites_pages.LinkedInPage, 55 key_mobile_sites_pages.LinkedInPage,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), 184 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'),
187 # Why: Top search engine 185 # Why: Top search engine
188 'http://www.bing.com/search?q=sloths', 186 'http://www.bing.com/search?q=sloths',
189 # Why: Good example of poor initial scrolling 187 # Why: Good example of poor initial scrolling
190 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' 188 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans'
191 ] 189 ]
192 190
193 for url in urls_list: 191 for url in urls_list:
194 self.AddUserStory(KeyMobileSitesRepaintPage( 192 self.AddUserStory(KeyMobileSitesRepaintPage(
195 url, self, mode=mode, height=height, width=width)) 193 url, self, mode=mode, height=height, width=width))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/key_mobile_sites_pages.py ('k') | tools/perf/page_sets/key_mobile_sites_smooth.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698