Commit 45a7a301 authored by Findit's avatar Findit

Revert "Chrome OS: Fix and re-enable LoginTest.GaiaAuthOffline test."

This reverts commit d4a2bb57.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 650550 as the
culprit for flakes in the build cycles as shown on:
https://analysis.chromium.org/p/chromium/flake-portal/analysis/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyQwsSDEZsYWtlQ3VscHJpdCIxY2hyb21pdW0vZDRhMmJiNTc1N2YyMTNlNjhiMDFkMDMwYjEwOTM1YjFkNjQ3MzRhMAw

Sample Failed Build: https://ci.chromium.org/buildbot/chromium.memory/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/32724

Sample Failed Step: browser_tests

Sample Flaky Test: LoginTest.GaiaAuthOffline

Original change's description:
> Chrome OS: Fix and re-enable LoginTest.GaiaAuthOffline test.
> 
> Bug: 692364
> 
> Change-Id: Ib42c71c66094088d4c0644ba3b151700e110351f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565710
> Commit-Queue: Alexander Alekseev <alemate@chromium.org>
> Reviewed-by: Toni Baržić <tbarzic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#650550}

Change-Id: I61dc50f4cc301438970d66f41555ed81e0cdf7b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 692364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1567093
Cr-Commit-Position: refs/heads/master@{#650621}
parent 280239be
......@@ -20,7 +20,6 @@
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/test/js_checker.h"
#include "chrome/browser/chromeos/login/test/test_condition_waiter.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_webui.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
......@@ -103,32 +102,51 @@ class LoginTest : public LoginManagerTest {
~LoginTest() override {}
void StartGaiaAuthOffline() {
auto gaia_screen_waiter = test::CreateOobeScreenWaiter("gaia-signin");
test::ExecuteOobeJS("$('error-offline-login-link').onclick();");
gaia_screen_waiter->Wait();
test::OobeJS().CreateVisibilityWaiter(true, {"offline-gaia"})->Wait();
content::DOMMessageQueue message_queue;
// clang-format off
const std::string js = "(function() {"
"var authenticator = $('gaia-signin').gaiaAuthHost_;"
"authenticator.addEventListener('ready',"
"function f() {"
"authenticator.removeEventListener('ready', f);"
"window.domAutomationController.send('offlineLoaded');"
"});"
"$('error-offline-login-link').onclick();"
"})();";
// clang-format on
test::ExecuteOobeJS(js);
std::string message;
do {
ASSERT_TRUE(message_queue.WaitForMessage(&message));
} while (message != "\"offlineLoaded\"");
}
void SubmitGaiaAuthOfflineForm(const std::string& user_email,
const std::string& password) {
const std::string animated_pages =
"document.querySelector('#offline-gaia /deep/ "
"#animatedPages')";
content::DOMMessageQueue message_queue;
test::OobeJS().ExpectVisible("offline-gaia");
test::OobeJS().ExpectHidden("signin-frame");
test::OobeJS()
.CreateDisplayedWaiter(true, {"offline-gaia", "email-section"})
->Wait();
test::OobeJS()
.CreateDisplayedWaiter(false, {"offline-gaia", "password-section"})
->Wait();
const std::string js =
animated_pages +
".addEventListener('neon-animation-finish',"
"function() {"
"window.domAutomationController.send('switchToPassword');"
"})";
test::ExecuteOobeJS(js);
test::OobeJS().TypeIntoPath(user_email, {"offline-gaia", "emailInput"});
test::OobeJS().TapOnPath({"offline-gaia", "email-input-form", "button"});
test::OobeJS()
.CreateDisplayedWaiter(false, {"offline-gaia", "email-section"})
->Wait();
test::OobeJS()
.CreateDisplayedWaiter(true, {"offline-gaia", "password-section"})
->Wait();
test::OobeJS().TapOnPath({"offline-gaia", "emailSection", "button"});
std::string message;
do {
ASSERT_TRUE(message_queue.WaitForMessage(&message));
} while (message != "\"switchToPassword\"");
test::OobeJS().TypeIntoPath(password, {"offline-gaia", "passwordInput"});
test::OobeJS().TapOnPath({"offline-gaia", "password-input-form", "button"});
test::OobeJS().TapOnPath({"offline-gaia", "passwordSection", "button"});
}
void PrepareOfflineLogin() {
......@@ -145,6 +163,10 @@ class LoginTest : public LoginManagerTest {
user_context.SetKey(Key(kPassword));
SetExpectedCredentials(user_context);
}
protected:
ScopedCrosSettingsTestHelper settings_helper_{
/* create_settings_service= */ false};
};
// Used to make sure that the system tray is visible and within the screen
......@@ -219,10 +241,11 @@ IN_PROC_BROWSER_TEST_F(LoginSigninTest, WebUIVisible) {
IN_PROC_BROWSER_TEST_F(LoginTest, PRE_GaiaAuthOffline) {
RegisterUser(AccountId::FromUserEmailGaiaId(kTestUser, kGaiaId));
StartupUtils::MarkOobeCompleted();
CrosSettings::Get()->SetBoolean(kAccountsPrefShowUserNamesOnSignIn, false);
settings_helper_.SetBoolean(kAccountsPrefShowUserNamesOnSignIn, false);
}
IN_PROC_BROWSER_TEST_F(LoginTest, GaiaAuthOffline) {
// Flaky, see http://crbug/692364.
IN_PROC_BROWSER_TEST_F(LoginTest, DISABLED_GaiaAuthOffline) {
PrepareOfflineLogin();
content::WindowedNotificationObserver session_start_waiter(
chrome::NOTIFICATION_SESSION_STARTED,
......
......@@ -65,7 +65,7 @@
[[i18nDynamic(locale, 'enterpriseInfoMessage', domain)]]
</div>
</div>
<gaia-input-form id="email-input-form" on-submit="onEmailSubmitted_"
<gaia-input-form on-submit="onEmailSubmitted_"
disabled="[[disabled]]"
button-text="[[i18nDynamic(locale, 'offlineLoginNextBtn')]]">
<gaia-input slot="inputs" id="emailInput" type="email" required
......@@ -85,7 +85,7 @@
</div>
<div id="subtitle-container">
</div>
<gaia-input-form id="password-input-form" disabled="[[disabled]]"
<gaia-input-form disabled="[[disabled]]"
on-submit="onPasswordSubmitted_"
button-text="[[i18nDynamic(locale, 'offlineLoginNextBtn')]]">
<gaia-input slot="inputs" id="passwordInput" type="password"
......
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