Commit 333799d2 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Chrome OS OOBE: Fix Authenticator variable names

This CL renames variables that have obsolete names like "gaiaAuthHost",
now that the "GaiaAuthHost" class doesn't exist anymore and is finally
renamed to "Authenticator" everywhere (see crrev.com/c/1605919).

Also fixes some comments that were referring to the old "auth host"
thing.

This is a pure refactoring CL, no functional changes are expected.

Bug: 470893
Test: existing tests
Change-Id: Ia07803527e0bf9148e021266cb2e2bc9a1fa67ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617832Reviewed-by: default avatarDenis Kuznetsov <antrim@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661360}
parent 0ada2d64
......@@ -396,9 +396,9 @@ class SamlTest : public OobeBaseTest {
void SetupAuthFlowChangeListener() {
content::ExecuteScriptAsync(
GetLoginUI()->GetWebContents(),
"$('gaia-signin').gaiaAuthHost_.addEventListener('authFlowChange',"
"$('gaia-signin').authenticator_.addEventListener('authFlowChange',"
" function f() {"
" $('gaia-signin').gaiaAuthHost_.removeEventListener("
" $('gaia-signin').authenticator_.removeEventListener("
" 'authFlowChange', f);"
" window.domAutomationController.send("
" $('gaia-signin').isSAML() ? 'SamlLoaded' : 'GaiaLoaded');"
......@@ -540,7 +540,7 @@ IN_PROC_BROWSER_TEST_F(SamlTest, ScrapedSingle) {
// Make sure that the password is scraped correctly.
ASSERT_TRUE(content::ExecuteScript(
GetLoginUI()->GetWebContents(),
"$('gaia-signin').gaiaAuthHost_.addEventListener('authCompleted',"
"$('gaia-signin').authenticator_.addEventListener('authCompleted',"
" function(e) {"
" var password = e.detail.password;"
" window.domAutomationController.send(password);"
......@@ -743,14 +743,14 @@ IN_PROC_BROWSER_TEST_F(SamlTest, NoticeUpdatedOnRedirect) {
"var processEventsAndSendIfHostFound = function() {"
" window.setTimeout(function() {"
" if (sendIfHostFound()) {"
" $('gaia-signin').gaiaAuthHost_.removeEventListener("
" $('gaia-signin').authenticator_.removeEventListener("
" 'authDomainChange',"
" processEventsAndSendIfHostFound);"
" }"
" }, 0);"
"};"
"if (!sendIfHostFound()) {"
" $('gaia-signin').gaiaAuthHost_.addEventListener("
" $('gaia-signin').authenticator_.addEventListener("
" 'authDomainChange',"
" processEventsAndSendIfHostFound);"
"}";
......@@ -1088,7 +1088,7 @@ void SAMLPolicyTest::ShowGAIALoginForm() {
content::DOMMessageQueue message_queue;
ASSERT_TRUE(content::ExecuteScript(
GetLoginUI()->GetWebContents(),
"$('gaia-signin').gaiaAuthHost_.addEventListener('ready', function() {"
"$('gaia-signin').authenticator_.addEventListener('ready', function() {"
" window.domAutomationController.send('ready');"
"});"));
ASSERT_TRUE(test::LoginScreenTester().ClickAddUserButton());
......@@ -1146,7 +1146,7 @@ void SAMLPolicyTest::ClickChangeAccountOnSAMLInterstitialPage() {
content::DOMMessageQueue message_queue;
ASSERT_TRUE(content::ExecuteScript(
GetLoginUI()->GetWebContents(),
"$('gaia-signin').gaiaAuthHost_.addEventListener('ready', function() {"
"$('gaia-signin').authenticator_.addEventListener('ready', function() {"
" window.domAutomationController.send('ready');"
"});"
"$('saml-interstitial').changeAccountLink.click();"));
......
......@@ -14,7 +14,7 @@ namespace test {
namespace {
constexpr char kGaiaAuthenticator[] = "$('gaia-signin').gaiaAuthHost_";
constexpr char kGaiaAuthenticator[] = "$('gaia-signin').authenticator_";
constexpr char kEnrollmentAuthenticator[] =
"$('oauth-enrollment').authenticator_";
......
......@@ -62,7 +62,7 @@ class OobeBaseTest : public MixinBasedInProcessBrowserTest {
std::unique_ptr<content::WindowedNotificationObserver>
login_screen_load_observer_;
std::string gaia_frame_parent_ = "signin-frame";
std::string authenticator_id_ = "$('gaia-signin').gaiaAuthHost_";
std::string authenticator_id_ = "$('gaia-signin').authenticator_";
EmbeddedTestServerSetupMixin embedded_test_server_{&mixin_host_,
embedded_test_server()};
......
......@@ -300,7 +300,7 @@ IN_PROC_BROWSER_TEST_F(WebviewLoginTest, BackButton) {
IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowNewUser) {
WaitForGaiaPageLoad();
std::string frame_url = "$('gaia-signin').gaiaAuthHost_.reloadUrl_";
std::string frame_url = "$('gaia-signin').authenticator_.reloadUrl_";
// New users are allowed.
test::OobeJS().ExpectTrue(frame_url + ".search('flow=nosignup') == -1");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment