Skip to content

Commit

Permalink
[ash-chrome] FakeGaia send closeView by default
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
Roman Sorokin authored and Chromium LUCI CQ committed Jun 16, 2021
1 parent 98c6afd commit 732fc19
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 1 addition & 2 deletions chrome/browser/ash/login/oobe_interactive_ui_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion chrome/browser/ash/login/webview_login_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions google_apis/test/embedded_setup_chromeos.html
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -138,7 +139,7 @@
services = [];
} else {
console.warn("Services are not set for testing.");
if (gaia.chromeOSLogin.sendImplicitServices)
if (gaia.chromeOSLogin.shouldSendImplicitServices)
services = []
}

Expand All @@ -152,6 +153,8 @@
}
if (services)
gaia.chromeOSLogin.sendUserInfo(services);
if (gaia.chromeOSLogin.shouldSendCloseView)
gaia.chromeOSLogin.sendCloseView();
history.pushState({}, "", window.location.pathname + "#close");
}
};
Expand Down

0 comments on commit 732fc19

Please sign in to comment.