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

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

Issue 313383002: Cleanup interaction creation and add ExecuteJavaScript to action_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 2014 The Chromium Authors. All rights reserved. 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 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 # pylint: disable=W0401,W0614 4 # pylint: disable=W0401,W0614
5 from telemetry.page.actions.all_page_actions import * 5 from telemetry.page.actions.all_page_actions import *
6 from telemetry.page import page as page_module 6 from telemetry.page import page as page_module
7 from telemetry.page import page_set as page_set_module 7 from telemetry.page import page_set as page_set_module
8 8
9 9
10 class CalendarForwardBackwardPage(page_module.Page): 10 class CalendarForwardBackwardPage(page_module.Page):
(...skipping 14 matching lines...) Expand all
25 action_runner.NavigateToPage(self) 25 action_runner.NavigateToPage(self)
26 action_runner.RunAction(WaitAction( 26 action_runner.RunAction(WaitAction(
27 { 27 {
28 'seconds': 2 28 'seconds': 2
29 })) 29 }))
30 action_runner.RunAction(WaitAction( 30 action_runner.RunAction(WaitAction(
31 { 31 {
32 'condition': 'element', 32 'condition': 'element',
33 'selector': 'div[class~="navForward"]' 33 'selector': 'div[class~="navForward"]'
34 })) 34 }))
35 action_runner.RunAction(JavascriptAction( 35 action_runner.ExecuteJavaScript('''
36 { 36 (function() {
37 'expression': ''' 37 var elem = document.createElement('meta');
38 (function() { 38 elem.name='viewport';
39 var elem = document.createElement('meta'); 39 elem.content='initial-scale=1';
40 elem.name='viewport'; 40 document.body.appendChild(elem);
41 elem.content='initial-scale=1'; 41 })();''')
42 document.body.appendChild(elem);
43 })();'''
44 }))
45 42
46 def RunEndure(self, action_runner): 43 def RunEndure(self, action_runner):
47 action_runner.RunAction(ClickElementAction( 44 action_runner.RunAction(ClickElementAction(
48 { 45 {
49 'selector': 'div[class~="navForward"]' 46 'selector': 'div[class~="navForward"]'
50 })) 47 }))
51 action_runner.RunAction(WaitAction( 48 action_runner.RunAction(WaitAction(
52 { 49 {
53 'seconds': 2 50 'seconds': 2
54 })) 51 }))
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 151
155 """ Chrome Endure test for Google Calendar. """ 152 """ Chrome Endure test for Google Calendar. """
156 153
157 def __init__(self): 154 def __init__(self):
158 super(CalendarForwardBackwardPageSet, self).__init__( 155 super(CalendarForwardBackwardPageSet, self).__init__(
159 credentials_path='data/credentials.json', 156 credentials_path='data/credentials.json',
160 user_agent_type='desktop', 157 user_agent_type='desktop',
161 archive_data_file='data/calendar_forward_backward.json') 158 archive_data_file='data/calendar_forward_backward.json')
162 159
163 self.AddPage(CalendarForwardBackwardPage(self)) 160 self.AddPage(CalendarForwardBackwardPage(self))
OLDNEW
« no previous file with comments | « tools/perf/measurements/timeline_controller.py ('k') | tools/perf/page_sets/gmail_compose_discard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698