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

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

Issue 1393023002: Move CT pages / page sets / benchmarks into Telemetry repo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 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 unified diff | Download patch
« no previous file with comments | « tools/perf/ct_benchmarks_util.py ('k') | 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
(Empty)
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
3 # found in the LICENSE file.
4
5
6 from page_sets import repaint_helpers
7
8 from telemetry.page import page as page_module
9 from telemetry.page import shared_page_state
10 from telemetry import story
11
12
13 class CTPage(page_module.Page):
14
15 def __init__(self, url, page_set, shared_page_state_class, archive_data_file):
16 super(CTPage, self).__init__(
17 url=url,
18 page_set=page_set,
19 shared_page_state_class=shared_page_state_class)
20 self.archive_data_file = archive_data_file
21
22 def RunNavigateSteps(self, action_runner):
23 action_runner.Navigate(self.url)
24 action_runner.Wait(2)
25
26 def RunPageInteractions(self, action_runner):
27 repaint_helpers.Repaint(action_runner)
28
29
30 class CTPageSet(story.StorySet):
31 """Page set used by CT Benchmarks."""
32
33 def __init__(self, urls_list, user_agent, archive_data_file):
34 if user_agent == 'mobile':
35 shared_page_state_class = shared_page_state.SharedMobilePageState
36 elif user_agent == 'desktop':
37 shared_page_state_class = shared_page_state.SharedDesktopPageState
38 else:
39 raise ValueError('user_agent %s is unrecognized' % user_agent)
40
41 super(CTPageSet, self).__init__(archive_data_file=archive_data_file)
42
43 for url in urls_list.split(','):
44 self.AddStory(
45 CTPage(url, self, shared_page_state_class, archive_data_file))
OLDNEW
« no previous file with comments | « tools/perf/ct_benchmarks_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698