Commit f1ae498f authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Use waiter instead of check in EnterpriseEnrollmentConfigurationTest

Bug: 944408
Change-Id: Iaad3ea649321b7a3af37f6ae74b059f005289261
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539997Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644736}
parent 002c62bd
...@@ -121,14 +121,12 @@ class EnterpriseEnrollmentConfigurationTest : public OobeBaseTest { ...@@ -121,14 +121,12 @@ class EnterpriseEnrollmentConfigurationTest : public OobeBaseTest {
NetworkHandler::Get()->network_state_handler()->SetCheckPortalList(""); NetworkHandler::Get()->network_state_handler()->SetCheckPortalList("");
} }
// Returns true if there are any OAuth-Enroll DOM elements with the given // Waits until specific enrollment step is displayed.
// class. void WaitForStep(const std::string& step) {
bool IsStepDisplayed(const std::string& step) {
const std::string js = const std::string js =
"document.getElementsByClassName('oauth-enroll-state-" + step + "document.getElementsByClassName('oauth-enroll-state-" + step +
"').length"; "').length > 0";
int count = test::OobeJS().GetInt(js); test::OobeJS().CreateWaiter(js)->Wait();
return count > 0;
} }
protected: protected:
...@@ -278,7 +276,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestAcceptEula) { ...@@ -278,7 +276,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestAcceptEula) {
IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestSkipUpdate) { IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestSkipUpdate) {
LoadConfiguration(); LoadConfiguration();
OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait(); OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait();
EXPECT_TRUE(IsStepDisplayed("signin")); WaitForStep("signin");
} }
// Check that when configuration has requisition, it gets applied at the // Check that when configuration has requisition, it gets applied at the
...@@ -304,8 +302,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, ...@@ -304,8 +302,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest,
"00000000-1111-2222-3333-444444444444"); "00000000-1111-2222-3333-444444444444");
LoadConfiguration(); LoadConfiguration();
OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait(); OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait();
test::OobeJS().Evaluate(";"); WaitForStep("success");
EXPECT_TRUE(IsStepDisplayed("success"));
} }
// Check that HID detection screen is shown if it is not specified by // Check that HID detection screen is shown if it is not specified by
......
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