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

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

Issue 180873008: Add support for python pageset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | tools/telemetry/telemetry/page/actions/javascript.py » ('j') | 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 2014 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 from telemetry.page.actions.javascript import JavascriptAction
6 from telemetry.page.actions.navigate import NavigateAction
7 from telemetry.page.actions.scroll import ScrollAction
8 from telemetry.page.actions.wait import WaitAction
9 from telemetry.page.python_page_set import PythonPageSet
10 from telemetry.page.page import Page
11
12 class ScrollPage(Page):
13 def __init__(self, url='', navigate_steps=None, credentials=''):
14 super(ScrollPage, self).__init__(url, '')
15 if not navigate_steps:
16 self._navigate_steps = []
17 else:
18 self._navigate_steps = navigate_steps
19
20 @property
21 def navigate_steps():
22 return self._navigate_steps
23
24 @property
25 def smoothness():
26 return [ScrollAction()]
27
28 class Top10(PythonPageSet):
29 def __init__(self):
30 super(Top10, self).__init__(
31 description='10 Pages chosen from Alexa top sites',
32 archive_data_file='data/top_10.json',
33 credentials_path='data/credentials.json',
34 user_agent_type='desktop')
35
36 self.AddPages(
37 #top google property; a google tab is often open
nduca 2014/02/27 18:26:57 from our chat class Top10(PageSet): def __init_
nednguyen 2014/02/27 19:49:33 Done.
38 ScrollPage(url='https://www.google.com/#hl=en&q=barack+obama',
39 navigate_steps=[
40 NavigateAction(),
41 WaitAction().UntilTextElementAvailable(text='Next')]),
42 #productivity, top google properties
43 ScrollPage(url='https://mail.google.com/mail/',
44 navigate_steps=[
45 NavigateAction(),
46 WaitAction.UntilTrue(
47 expression='''window.gmonkey !== undefined &&
48 document.getElementById('gb') !== null''')]),
49 #productivity, top google properties
50 ScrollPage(url='https://google.com/calendar/',
51 navigate_steps=[
52 NavigateAction(),
53 JavascriptAction().OfExpression(
54 '''(function() { var elem = document.createElement("meta");
55 elem.name="viewport";
56 elem.content="initial-scale=1";
57 document.body.appendChild(elem); })();'''),
58 WaitAction().ForSeconds(2),
59 WaitAction().UntilSelectorElementAvailable(
60 selector='div[class~="navForward"]')],
61 credentials='google'))
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/actions/javascript.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698