1# Copyright (c) 2012 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 5from telemetry.core.chrome import form_based_credentials_backend 6 7class GoogleCredentialsBackend( 8 form_based_credentials_backend.FormBasedCredentialsBackend): 9 def IsAlreadyLoggedIn(self, tab): 10 return tab.EvaluateJavaScript( 11 'document.getElementById("gb")!== null') 12 13 @property 14 def credentials_type(self): 15 return 'google' 16 17 @property 18 def url(self): 19 return 'https://accounts.google.com/' 20 21 @property 22 def login_form_id(self): 23 return 'gaia_loginform' 24 25 @property 26 def login_input_id(self): 27 return 'Email' 28 29 @property 30 def password_input_id(self): 31 return 'Passwd' 32