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

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

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 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 from page_sets.login_helpers import google_login 5 from page_sets.login_helpers import google_login
6 6
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.util import js_template 9 from telemetry.util import js_template
10 10
(...skipping 20 matching lines...) Expand all
31 shared_page_state_class=shared_page_state.SharedPageState): 31 shared_page_state_class=shared_page_state.SharedPageState):
32 super(GmailPage, self).__init__( 32 super(GmailPage, self).__init__(
33 url='https://mail.google.com/mail/', 33 url='https://mail.google.com/mail/',
34 page_set=page_set, 34 page_set=page_set,
35 shared_page_state_class=shared_page_state_class) 35 shared_page_state_class=shared_page_state_class)
36 36
37 def RunNavigateSteps(self, action_runner): 37 def RunNavigateSteps(self, action_runner):
38 google_login.LoginGoogleAccount(action_runner, 'google', 38 google_login.LoginGoogleAccount(action_runner, 'google',
39 self.credentials_path) 39 self.credentials_path)
40 super(GmailPage, self).RunNavigateSteps(action_runner) 40 super(GmailPage, self).RunNavigateSteps(action_runner)
41 action_runner.WaitForJavaScriptCondition2( 41 action_runner.WaitForJavaScriptCondition(
42 'window.gmonkey !== undefined &&' 42 'window.gmonkey !== undefined &&'
43 'document.getElementById("gb") !== null') 43 'document.getElementById("gb") !== null')
44 44
45 class GoogleDocPage(GooglePages): 45 class GoogleDocPage(GooglePages):
46 def __init__(self, page_set, 46 def __init__(self, page_set,
47 shared_page_state_class=shared_page_state.SharedPageState): 47 shared_page_state_class=shared_page_state.SharedPageState):
48 super(GoogleDocPage, self).__init__( 48 super(GoogleDocPage, self).__init__(
49 # pylint: disable=line-too-long 49 # pylint: disable=line-too-long
50 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3m fTpAPUSX3_s4/view', 50 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3m fTpAPUSX3_s4/view',
51 page_set=page_set, 51 page_set=page_set,
52 shared_page_state_class=shared_page_state_class) 52 shared_page_state_class=shared_page_state_class)
53 53
54 def RunNavigateSteps(self, action_runner): 54 def RunNavigateSteps(self, action_runner):
55 google_login.LoginGoogleAccount(action_runner, 'google', 55 google_login.LoginGoogleAccount(action_runner, 'google',
56 self.credentials_path) 56 self.credentials_path)
57 super(GoogleDocPage, self).RunNavigateSteps(action_runner) 57 super(GoogleDocPage, self).RunNavigateSteps(action_runner)
58 action_runner.Wait(2) 58 action_runner.Wait(2)
59 action_runner.WaitForJavaScriptCondition2( 59 action_runner.WaitForJavaScriptCondition(
60 'document.getElementsByClassName("kix-appview-editor").length') 60 'document.getElementsByClassName("kix-appview-editor").length')
61 61
62 62
63 INTERACTION_NAME = 'Interaction.AppLoad' 63 INTERACTION_NAME = 'Interaction.AppLoad'
64 class AdwordCampaignDesktopPage(page_module.Page): 64 class AdwordCampaignDesktopPage(page_module.Page):
65 def __init__(self, page_set): 65 def __init__(self, page_set):
66 super(AdwordCampaignDesktopPage, self).__init__( 66 super(AdwordCampaignDesktopPage, self).__init__(
67 url='https://adwords.google.com/cm/CampaignMgmt', 67 url='https://adwords.google.com/cm/CampaignMgmt',
68 page_set=page_set, name='AdwordsCampaign', 68 page_set=page_set, name='AdwordsCampaign',
69 credentials_path='data/credentials.json', 69 credentials_path='data/credentials.json',
70 shared_page_state_class=shared_page_state.SharedDesktopPageState) 70 shared_page_state_class=shared_page_state.SharedDesktopPageState)
71 self.script_to_evaluate_on_commit = js_template.Render( 71 self.script_to_evaluate_on_commit = js_template.Render(
72 'console.time({{ label }});', label=INTERACTION_NAME) 72 'console.time({{ label }});', label=INTERACTION_NAME)
73 73
74 def RunNavigateSteps(self, action_runner): 74 def RunNavigateSteps(self, action_runner):
75 google_login.LoginGoogleAccount(action_runner, 'google3', 75 google_login.LoginGoogleAccount(action_runner, 'google3',
76 self.credentials_path) 76 self.credentials_path)
77 super(AdwordCampaignDesktopPage, self).RunNavigateSteps(action_runner) 77 super(AdwordCampaignDesktopPage, self).RunNavigateSteps(action_runner)
78 78
79 def RunPageInteractions(self, action_runner): 79 def RunPageInteractions(self, action_runner):
80 action_runner.WaitForElement(text='Welcome to AdWords!') 80 action_runner.WaitForElement(text='Welcome to AdWords!')
81 action_runner.ExecuteJavaScript2( 81 action_runner.ExecuteJavaScript(
82 'console.timeEnd({{ label }});', label=INTERACTION_NAME) 82 'console.timeEnd({{ label }});', label=INTERACTION_NAME)
OLDNEW
« no previous file with comments | « tools/perf/page_sets/dummy_story_set.py ('k') | tools/perf/page_sets/image_decoding_measurement.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698