0

[ash-chrome] FakeGaia send closeView by default

Otherwise authentication waits extra 5 seconds which slows down tests

Bug: 1214917
Change-Id: I2856015c244e2db34dcedceef69ae153fb82a65b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2965177
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#892965}
This commit is contained in:
Roman Sorokin
2021-06-16 12:12:23 +00:00
committed by Chromium LUCI CQ
parent 98c6afd4d1
commit 732fc195bf
3 changed files with 20 additions and 5 deletions

@ -826,9 +826,8 @@ void OobeZeroTouchInteractiveUITest::ZeroTouchEndToEnd() {
// crbug.com/997987. Disabled on MSAN since they time out.
// crbug.com/1055853: EndToEnd is flaky on Linux Chromium OS ASan LSan
// crbug.com/1214917: EndToEnd is flaky on linux-chromeos-dbg
#if defined(MEMORY_SANITIZER) || defined(ADDRESS_SANITIZER) || \
defined(LEAK_SANITIZER) || !defined(NDEBUG)
defined(LEAK_SANITIZER)
#define MAYBE_EndToEnd DISABLED_EndToEnd
#else
#define MAYBE_EndToEnd EndToEnd

@ -352,7 +352,12 @@ class WebviewLoginTest : public OobeBaseTest {
void DisableImplicitServices() {
SigninFrameJS().ExecuteAsync(
"gaia.chromeOSLogin.sendImplicitServices = false");
"gaia.chromeOSLogin.shouldSendImplicitServices = false");
}
void DisableCloseViewMessage() {
SigninFrameJS().ExecuteAsync(
"gaia.chromeOSLogin.shouldSendCloseView = false");
}
void WaitForServicesSet() {
@ -436,6 +441,8 @@ class WebviewCloseViewLoginTest
IN_PROC_BROWSER_TEST_P(WebviewCloseViewLoginTest, NativeTest) {
WaitForGaiaPageLoadAndPropertyUpdate();
ExpectIdentifierPage();
// Test will send `closerView` manually (if the feature is enabled).
DisableCloseViewMessage();
SigninFrameJS().TypeIntoPath(FakeGaiaMixin::kFakeUserEmail,
FakeGaiaMixin::kEmailPath);
test::OobeJS().ClickOnPath(kPrimaryButton);
@ -503,6 +510,8 @@ IN_PROC_BROWSER_TEST_P(WebviewCloseViewLoginTest, Basic) {
WaitForGaiaPageLoadAndPropertyUpdate();
ExpectIdentifierPage();
// Test will send `closerView` manually (if the feature is enabled).
DisableCloseViewMessage();
SigninFrameJS().TypeIntoPath(FakeGaiaMixin::kFakeUserEmail,
FakeGaiaMixin::kEmailPath);
@ -547,6 +556,8 @@ IN_PROC_BROWSER_TEST_P(WebviewCloseViewLoginTest, BackButton) {
// Start with identifer page.
ExpectIdentifierPage();
// Test will send `closerView` manually (if the feature is enabled).
DisableCloseViewMessage();
// Move to password page.
auto back_button_waiter = CreateGaiaPageEventWaiter("backButton");
@ -1737,6 +1748,8 @@ IN_PROC_BROWSER_TEST_P(WebviewCloseViewLoginTest, MAYBE_UserInfoNeverSent) {
WaitForGaiaPageLoadAndPropertyUpdate();
ExpectIdentifierPage();
DisableImplicitServices();
// Test will send `closerView` manually (if the feature is enabled).
DisableCloseViewMessage();
SigninFrameJS().TypeIntoPath(FakeGaiaMixin::kFakeUserEmail,
FakeGaiaMixin::kEmailPath);
test::OobeJS().ClickOnPath(kPrimaryButton);

@ -9,7 +9,8 @@ gaia.chromeOSLogin.parent_webview_oob_url_ = 'chrome://oobe';
gaia.chromeOSLogin.parent_webview_ = undefined;
gaia.chromeOSLogin.parent_webview_url_ = undefined;
gaia.chromeOSLogin.initialized_ = false;
gaia.chromeOSLogin.sendImplicitServices = true;
gaia.chromeOSLogin.shouldSendImplicitServices = true;
gaia.chromeOSLogin.shouldSendCloseView = true;
const urlParams = new URLSearchParams(window.location.search);
const useNativeNavigation = !!urlParams.get('use_native_navigation');
@ -138,7 +139,7 @@ function goNext() {
services = [];
} else {
console.warn("Services are not set for testing.");
if (gaia.chromeOSLogin.sendImplicitServices)
if (gaia.chromeOSLogin.shouldSendImplicitServices)
services = []
}
@ -152,6 +153,8 @@ function goNext() {
}
if (services)
gaia.chromeOSLogin.sendUserInfo(services);
if (gaia.chromeOSLogin.shouldSendCloseView)
gaia.chromeOSLogin.sendCloseView();
history.pushState({}, "", window.location.pathname + "#close");
}
};