From 732fc195bfb33b22ea69f14b061856c55eb29aa2 Mon Sep 17 00:00:00 2001 From: Roman Sorokin Date: Wed, 16 Jun 2021 12:12:23 +0000 Subject: [PATCH] [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] Reviewed-by: Denis Kuznetsov [CET] Cr-Commit-Position: refs/heads/master@{#892965} --- .../browser/ash/login/oobe_interactive_ui_test.cc | 3 +-- .../ash/login/webview_login_browsertest.cc | 15 ++++++++++++++- google_apis/test/embedded_setup_chromeos.html | 7 +++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/chrome/browser/ash/login/oobe_interactive_ui_test.cc b/chrome/browser/ash/login/oobe_interactive_ui_test.cc index 5d0fac89f1175f..5aa3c405fdb297 100644 --- a/chrome/browser/ash/login/oobe_interactive_ui_test.cc +++ b/chrome/browser/ash/login/oobe_interactive_ui_test.cc @@ -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 diff --git a/chrome/browser/ash/login/webview_login_browsertest.cc b/chrome/browser/ash/login/webview_login_browsertest.cc index 585c528412aced..b96af75f6bc8e1 100644 --- a/chrome/browser/ash/login/webview_login_browsertest.cc +++ b/chrome/browser/ash/login/webview_login_browsertest.cc @@ -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); diff --git a/google_apis/test/embedded_setup_chromeos.html b/google_apis/test/embedded_setup_chromeos.html index 5f16521f92cc95..e49348461c9cbc 100644 --- a/google_apis/test/embedded_setup_chromeos.html +++ b/google_apis/test/embedded_setup_chromeos.html @@ -9,7 +9,8 @@ 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 @@ services = []; } else { console.warn("Services are not set for testing."); - if (gaia.chromeOSLogin.sendImplicitServices) + if (gaia.chromeOSLogin.shouldSendImplicitServices) services = [] } @@ -152,6 +153,8 @@ } if (services) gaia.chromeOSLogin.sendUserInfo(services); + if (gaia.chromeOSLogin.shouldSendCloseView) + gaia.chromeOSLogin.sendCloseView(); history.pushState({}, "", window.location.pathname + "#close"); } };