This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert of Revert of Add support for codepen to form_based_credentials…
…_background (patchset #9 of https://codereview.chromium.org/485743002/) Reason for revert: I believe the flakiness may have been fixed by https://codereview.chromium.org/520683002 BUG= Review URL: https://codereview.chromium.org/531733004 Cr-Commit-Position: refs/heads/master@{#292950}
- Loading branch information
1 parent
afba614
commit dab69c8
Showing
11 changed files
with
133 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
11752daf3b27c9ced2d530b5241cab7e5b109dd9 | ||
3a0f9c995a41e058857af7d9c2e265b046ba96e6 |
41 changes: 41 additions & 0 deletions
41
tools/telemetry/telemetry/core/backends/codepen_credentials_backend.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2014 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
from telemetry.core.backends import form_based_credentials_backend | ||
|
||
|
||
class CodePenCredentialsBackend( | ||
form_based_credentials_backend.FormBasedCredentialsBackend): | ||
|
||
@property | ||
def logged_in_javascript(self): | ||
"""Evaluates to true iff already logged in.""" | ||
return 'document.querySelector(".login-area") === null' | ||
|
||
@property | ||
def credentials_type(self): | ||
return 'codepen' | ||
|
||
@property | ||
def url(self): | ||
return 'https://codepen.io/login' | ||
|
||
@property | ||
def login_form_id(self): | ||
return 'login-login-form' | ||
|
||
@property | ||
def login_button_javascript(self): | ||
return """ | ||
LoginSettings.timeOnPageStartTime = 0; | ||
document.getElementById("log-in-button").click(); | ||
""" | ||
|
||
@property | ||
def login_input_id(self): | ||
return 'login-email-field' | ||
|
||
@property | ||
def password_input_id(self): | ||
return 'login-password-field_' |
18 changes: 18 additions & 0 deletions
18
tools/telemetry/telemetry/core/backends/codepen_credentials_backend_unittest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2014 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
from telemetry.core.backends import form_based_credentials_backend_unittest_base | ||
from telemetry.core.backends import codepen_credentials_backend | ||
|
||
|
||
class TestCodePenCredentialsBackend( | ||
form_based_credentials_backend_unittest_base. | ||
FormBasedCredentialsBackendUnitTestBase): | ||
def setUp(self): | ||
self._credentials_type = 'codepen' | ||
|
||
def testLoginUsingMock(self): | ||
backend = codepen_credentials_backend.CodePenCredentialsBackend() | ||
self._LoginUsingMock(backend, backend.url, backend.login_input_id, | ||
backend.password_input_id, backend.login_form_id, | ||
backend.logged_in_javascript) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters