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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/ct_benchmarks_util.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/ct_page_set.py
diff --git a/tools/perf/page_sets/ct_page_set.py b/tools/perf/page_sets/ct_page_set.py
new file mode 100644
index 0000000000000000000000000000000000000000..97debadf91f371614f04ef9c68913788e371c1ef
--- /dev/null
+++ b/tools/perf/page_sets/ct_page_set.py
@@ -0,0 +1,45 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+from page_sets import repaint_helpers
+
+from telemetry.page import page as page_module
+from telemetry.page import shared_page_state
+from telemetry import story
+
+
+class CTPage(page_module.Page):
+
+ def __init__(self, url, page_set, shared_page_state_class, archive_data_file):
+ super(CTPage, self).__init__(
+ url=url,
+ page_set=page_set,
+ shared_page_state_class=shared_page_state_class)
+ self.archive_data_file = archive_data_file
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.Navigate(self.url)
+ action_runner.Wait(2)
+
+ def RunPageInteractions(self, action_runner):
+ repaint_helpers.Repaint(action_runner)
+
+
+class CTPageSet(story.StorySet):
+ """Page set used by CT Benchmarks."""
+
+ def __init__(self, urls_list, user_agent, archive_data_file):
+ if user_agent == 'mobile':
+ shared_page_state_class = shared_page_state.SharedMobilePageState
+ elif user_agent == 'desktop':
+ shared_page_state_class = shared_page_state.SharedDesktopPageState
+ else:
+ raise ValueError('user_agent %s is unrecognized' % user_agent)
+
+ super(CTPageSet, self).__init__(archive_data_file=archive_data_file)
+
+ for url in urls_list.split(','):
+ self.AddStory(
+ CTPage(url, self, shared_page_state_class, archive_data_file))
« 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