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