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 from page_sets.login_helpers import chrome_login |
| 5 from telemetry import story |
| 6 from telemetry.page import page as page_module |
4 from telemetry.page import shared_page_state | 7 from telemetry.page import shared_page_state |
5 from telemetry.page import page as page_module | |
6 from telemetry.page import page_set as page_set_module | |
7 | |
8 from page_sets.login_helpers import chrome_login | |
9 | 8 |
10 | 9 |
11 class ChromeSigninPage(page_module.Page): | 10 class ChromeSigninPage(page_module.Page): |
12 """A page that signs in a user to Chrome.""" | 11 """A page that signs in a user to Chrome.""" |
13 | 12 |
14 def __init__(self, page_set): | 13 def __init__(self, page_set): |
15 super(ChromeSigninPage, self).__init__( | 14 super(ChromeSigninPage, self).__init__( |
16 url='chrome://signin-internals', | 15 url='chrome://signin-internals', |
17 page_set=page_set, | 16 page_set=page_set, |
18 credentials_path='data/chrome_signin_credentials.json', | 17 credentials_path='data/chrome_signin_credentials.json', |
19 credentials_bucket=page_set_module.INTERNAL_BUCKET, | 18 credentials_bucket=story.INTERNAL_BUCKET, |
20 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 19 shared_page_state_class=shared_page_state.SharedDesktopPageState) |
21 | 20 |
22 def RunPageInteractions(self, action_runner): | 21 def RunPageInteractions(self, action_runner): |
23 # Use page.credentials_path because it is automatically translated into a | 22 # Use page.credentials_path because it is automatically translated into a |
24 # full path relative to the page. | 23 # full path relative to the page. |
25 chrome_login.LoginChromeAccount(action_runner, 'chrome', | 24 chrome_login.LoginChromeAccount(action_runner, 'chrome', |
26 credentials_path=self.credentials_path) | 25 credentials_path=self.credentials_path) |
27 | 26 |
28 | 27 |
29 class ChromeSigninPageSet(page_set_module.PageSet): | 28 class ChromeSigninPageSet(story.StorySet): |
30 | 29 |
31 def __init__(self): | 30 def __init__(self): |
32 super(ChromeSigninPageSet, self).__init__( | 31 super(ChromeSigninPageSet, self).__init__( |
33 archive_data_file='data/chrome_signin_archive.json', | 32 archive_data_file='data/chrome_signin_archive.json', |
34 bucket=page_set_module.INTERNAL_BUCKET) | 33 cloud_storage_bucket=story.INTERNAL_BUCKET) |
35 self.AddUserStory(ChromeSigninPage(self)) | 34 self.AddUserStory(ChromeSigninPage(self)) |
OLD | NEW |