Commit 90b54c74 authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

cros: Fix Oobe.isEnrollmentSuccessfulForTest

The function checks a deleted element. I switched to checking enrollment
step.

Bug: 1042594
Test: manual call of the function in devtools
Change-Id: I3f0cdc0336bc6be431e68a798aee95d8447052a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2002513Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732607}
parent 5fc176f9
...@@ -342,10 +342,13 @@ cr.define('cr.ui', function() { ...@@ -342,10 +342,13 @@ cr.define('cr.ui', function() {
* attribute screen if it's present. * attribute screen if it's present.
*/ */
Oobe.isEnrollmentSuccessfulForTest = function() { Oobe.isEnrollmentSuccessfulForTest = function() {
if ($('enterprise-enrollment').$$('.oauth-enroll-state-attribute-prompt')) const step = $('enterprise-enrollment').currentStep_;
if (step === ENROLLMENT_STEP.ATTRIBUTE_PROMPT) {
chrome.send('oauthEnrollAttributes', ['', '']); chrome.send('oauthEnrollAttributes', ['', '']);
return true;
}
return !!$('enterprise-enrollment').$$('.oauth-enroll-state-success'); return step === ENROLLMENT_STEP.SUCCESS;
}; };
/** /**
......
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