OLD | NEW |
---|---|
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 | 9 |
10 import os | 10 import os |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 INTERACTION_NAME = 'Interaction.AppLoad' | 62 INTERACTION_NAME = 'Interaction.AppLoad' |
63 class AdwordCampaignDesktopPage(page_module.Page): | 63 class AdwordCampaignDesktopPage(page_module.Page): |
64 def __init__(self, page_set): | 64 def __init__(self, page_set): |
65 super(AdwordCampaignDesktopPage, self).__init__( | 65 super(AdwordCampaignDesktopPage, self).__init__( |
66 url='https://adwords.google.com/cm/CampaignMgmt', | 66 url='https://adwords.google.com/cm/CampaignMgmt', |
67 page_set=page_set, name='AdwordsCampaign', | 67 page_set=page_set, name='AdwordsCampaign', |
68 credentials_path='data/credentials.json', | 68 credentials_path='data/credentials.json', |
69 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 69 shared_page_state_class=shared_page_state.SharedDesktopPageState) |
70 self.script_to_evaluate_on_commit = ( | 70 self.script_to_evaluate_on_commit = ( |
71 'console.time("%s");' % INTERACTION_NAME) | 71 'console.time("%s");' % INTERACTION_NAME) |
nednguyen
2017/01/10 14:42:23
also change it here for consistency?
perezju
2017/01/10 14:53:01
Yup, thanks for pointing those out!
| |
72 | 72 |
73 def RunNavigateSteps(self, action_runner): | 73 def RunNavigateSteps(self, action_runner): |
74 google_login.LoginGoogleAccount(action_runner, 'google3', | 74 google_login.LoginGoogleAccount(action_runner, 'google3', |
75 self.credentials_path) | 75 self.credentials_path) |
76 super(AdwordCampaignDesktopPage, self).RunNavigateSteps(action_runner) | 76 super(AdwordCampaignDesktopPage, self).RunNavigateSteps(action_runner) |
77 | 77 |
78 def RunPageInteractions(self, action_runner): | 78 def RunPageInteractions(self, action_runner): |
79 action_runner.WaitForElement(text='Welcome to AdWords!') | 79 action_runner.WaitForElement(text='Welcome to AdWords!') |
80 # TODO(catapult:#3028): Fix interpolation of JavaScript values. | 80 action_runner.ExecuteJavaScript( |
81 action_runner.ExecuteJavaScript('console.timeEnd("%s");' % INTERACTION_NAME) | 81 'console.timeEnd({{ label }});', label=INTERACTION_NAME) |
OLD | NEW |