Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / backends / facebook_credentials_backend.py
1 # Copyright 2013 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
5 from telemetry.core.backends import form_based_credentials_backend
6
7
8 class FacebookCredentialsBackend(
9     form_based_credentials_backend.FormBasedCredentialsBackend):
10   def IsAlreadyLoggedIn(self, tab):
11     return tab.EvaluateJavaScript(
12         'document.getElementById("fbNotificationsList")!== null || '
13         'document.getElementById("m_home_notice")!== null')
14
15   @property
16   def credentials_type(self):
17     return 'facebook'
18
19   @property
20   def url(self):
21     return 'http://www.facebook.com/'
22
23   @property
24   def login_form_id(self):
25     return 'login_form'
26
27   @property
28   def login_input_id(self):
29     return 'email'
30
31   @property
32   def password_input_id(self):
33     return 'pass'