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

Side by Side Diff: tools/perf/contrib/cluster_telemetry/page_set.py

Issue 2941763004: Explicitly setting names for stories in unittests (Closed)
Patch Set: Created 3 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 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 4
5 5
6 from telemetry.page import traffic_setting as traffic_setting_module 6 from telemetry.page import traffic_setting as traffic_setting_module
7 from telemetry.page import page as page_module 7 from telemetry.page import page as page_module
8 from telemetry.page import shared_page_state 8 from telemetry.page import shared_page_state
9 from telemetry import story 9 from telemetry import story
10 10
11 11
12 class CTPage(page_module.Page): 12 class CTPage(page_module.Page):
13 13
14 def __init__(self, url, page_set, shared_page_state_class, archive_data_file, 14 def __init__(self, url, page_set, shared_page_state_class, archive_data_file,
15 traffic_setting, run_page_interaction_callback): 15 traffic_setting, run_page_interaction_callback):
16 super(CTPage, self).__init__( 16 super(CTPage, self).__init__(
17 url=url, 17 url=url,
18 page_set=page_set, 18 page_set=page_set,
19 shared_page_state_class=shared_page_state_class, 19 shared_page_state_class=shared_page_state_class,
20 traffic_setting=traffic_setting) 20 traffic_setting=traffic_setting,
21 name=url)
21 self.archive_data_file = archive_data_file 22 self.archive_data_file = archive_data_file
22 self._run_page_interaction_callback = run_page_interaction_callback 23 self._run_page_interaction_callback = run_page_interaction_callback
23 24
24 def RunNavigateSteps(self, action_runner): 25 def RunNavigateSteps(self, action_runner):
25 action_runner.Navigate(self.url) 26 action_runner.Navigate(self.url)
26 27
27 def RunPageInteractions(self, action_runner): 28 def RunPageInteractions(self, action_runner):
28 if self._run_page_interaction_callback: 29 if self._run_page_interaction_callback:
29 self._run_page_interaction_callback(action_runner) 30 self._run_page_interaction_callback(action_runner)
30 31
(...skipping 12 matching lines...) Expand all
43 raise ValueError('user_agent %s is unrecognized' % user_agent) 44 raise ValueError('user_agent %s is unrecognized' % user_agent)
44 45
45 super(CTPageSet, self).__init__(archive_data_file=archive_data_file) 46 super(CTPageSet, self).__init__(archive_data_file=archive_data_file)
46 47
47 for url in urls_list.split(','): 48 for url in urls_list.split(','):
48 self.AddStory( 49 self.AddStory(
49 CTPage(url, self, shared_page_state_class=shared_page_state_class, 50 CTPage(url, self, shared_page_state_class=shared_page_state_class,
50 archive_data_file=archive_data_file, 51 archive_data_file=archive_data_file,
51 traffic_setting=traffic_setting, 52 traffic_setting=traffic_setting,
52 run_page_interaction_callback=run_page_interaction_callback)) 53 run_page_interaction_callback=run_page_interaction_callback))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/blink_perf_unittest.py ('k') | tools/perf/contrib/oilpan/oilpan_gc_times_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698