Chromium Code Reviews| Index: tools/perf/page_sets/login_helpers/facebook_login.py |
| diff --git a/tools/perf/page_sets/login_helpers/facebook_login.py b/tools/perf/page_sets/login_helpers/facebook_login.py |
| index 360cf28da6f7f6fdaa77f10ba8b2c04a3ab068cf..d9539caa2d6f2d18290cb5dff52809fe3189cbf4 100644 |
| --- a/tools/perf/page_sets/login_helpers/facebook_login.py |
| +++ b/tools/perf/page_sets/login_helpers/facebook_login.py |
| @@ -33,3 +33,36 @@ def LoginWithMobileSite( |
| action_runner.WaitForElement(text='OK') |
| action_runner.ClickElement(text='OK') |
| action_runner.WaitForNavigate() |
| + |
| + |
| +def LoginWithDesktopSite( |
| + action_runner, credential, |
| + credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): |
| + """Logs in into desktop Facebook account. |
| + |
| + This function navigates the tab into Facebook's login page and logs in a user |
| + using credentials in |credential| part of the |credentials_path| file. |
| + |
| + Args: |
| + action_runner: Action runner responsible for running actions on the page. |
| + credential: The credential to retrieve from the credentials file |
| + (type string). |
| + credentials_path: The string that specifies the path to credential file. |
| + |
| + Raises: |
| + exceptions.Error: See ExecuteJavaScript() |
| + for a detailed list of possible exceptions. |
| + """ |
| + account_name, password = login_utils.GetAccountNameAndPassword( |
| + credential, credentials_path=credentials_path) |
| + |
| + # Currently we use the mobile login page also on Desktop because the |
|
charliea (OOO until 10-5)
2016/07/29 20:10:01
s/Desktop/desktop
charliea (OOO until 10-5)
2016/07/29 20:10:01
s/"we use the mobile login page also on Desktop"/"
|
| + # Desktop version requires enabled cookies and rejects the login. |
|
petrcermak
2016/08/01 11:22:30
In that case, why the code duplication? You can ju
Hannes Payer (out of office)
2016/08/04 11:38:01
Right on. Done.
|
| + action_runner.Navigate( |
| + 'https://m.facebook.com/login?continue=https%3A%2F%2Fm.facebook.com') |
| + login_utils.InputWithSelector(action_runner, account_name, '[name=email]') |
| + login_utils.InputWithSelector(action_runner, password, '[name=pass]') |
| + action_runner.ClickElement(selector='[name=login]') |
| + action_runner.WaitForElement(text='OK') |
| + action_runner.ClickElement(text='OK') |
| + action_runner.WaitForNavigate() |