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

Unified Diff: tools/perf/page_sets/simple_mobile_sites.py

Issue 400873002: Telemetry: Add simple mobile page-set with smoothness/thread-times. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 5 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
Index: tools/perf/page_sets/simple_mobile_sites.py
diff --git a/tools/perf/page_sets/simple_mobile_sites.py b/tools/perf/page_sets/simple_mobile_sites.py
new file mode 100644
index 0000000000000000000000000000000000000000..e072df4f0060bb470dcbf8c3970a8cbbd5ad3413
--- /dev/null
+++ b/tools/perf/page_sets/simple_mobile_sites.py
@@ -0,0 +1,56 @@
+# Copyright 2014 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 telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class SimplePage(page_module.Page):
+
+ def __init__(self, url, page_set):
+ super(SimplePage, self).__init__(url=url, page_set=page_set)
+ self.credentials_path = 'data/credentials.json'
+ self.archive_data_file = 'data/simple_mobile_sites.json'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.NavigateToPage(self)
+ # TODO(epenner): Remove this wait (http://crbug.com/366933)
+ action_runner.Wait(5)
+
+class SimpleScrollPage(SimplePage):
+
+ def __init__(self, url, page_set):
+ super(SimpleScrollPage, self).__init__(url=url, page_set=page_set)
+
+ def RunSmoothness(self, action_runner):
+ # Make the scroll longer to reduce noise.
+ interaction = action_runner.BeginGestureInteraction(
+ 'ScrollAction', is_smooth=True)
+ action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=300)
+ interaction.End()
+
+class SimpleMobileSitesPageSet(page_set_module.PageSet):
+
+ """ Simple mobile sites """
+
+ def __init__(self):
+ super(SimpleMobileSitesPageSet, self).__init__(
+ credentials_path='data/credentials.json',
+ user_agent_type='tablet_10_inch',
+ archive_data_file='data/simple_mobile_sites.json',
+ bucket=page_set_module.PUBLIC_BUCKET)
+
+ scroll_page_list = [
+ # Why: Scrolls moderately complex pages (up to 60 layers)
+ 'http://www.ebay.co.uk/',
+ 'https://www.flickr.com/',
+ 'http://www.apple.com/mac/',
+ 'http://www.nyc.gov',
+ 'http://m.nytimes.com/',
+ 'https://www.yahoo.com/',
+ 'http://m.us.wsj.com/',
+ ]
+
+ for url in scroll_page_list:
+ self.AddPage(SimpleScrollPage(url, self))
+
« no previous file with comments | « tools/perf/page_sets/data/simple_mobile_sites_002.wpr.sha1 ('k') | tools/telemetry/telemetry/core/user_agent.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698