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 {
NetworkHandler::Get()->network_state_handler()->SetCheckPortalList("");
}
// Returns true if there are any OAuth-Enroll DOM elements with the given
// class.
bool IsStepDisplayed(const std::string& step) {
// Waits until specific enrollment step is displayed.
void WaitForStep(const std::string& step) {
const std::string js =
"document.getElementsByClassName('oauth-enroll-state-" + step +
"').length";
int count = test::OobeJS().GetInt(js);
return count > 0;
"').length > 0";
test::OobeJS().CreateWaiter(js)->Wait();
}
protected:
......@@ -278,7 +276,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestAcceptEula) {
IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest, TestSkipUpdate) {
LoadConfiguration();
OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait();
EXPECT_TRUE(IsStepDisplayed("signin"));
WaitForStep("signin");
}
// Check that when configuration has requisition, it gets applied at the
......@@ -304,8 +302,7 @@ IN_PROC_BROWSER_TEST_F(EnterpriseEnrollmentConfigurationTest,
"00000000-1111-2222-3333-444444444444");
LoadConfiguration();
OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENROLLMENT).Wait();
test::OobeJS().Evaluate(";");
EXPECT_TRUE(IsStepDisplayed("success"));
WaitForStep("success");
}
// 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