Fix login spinner visibility race after SAML login
This fix part 1/2 for the bug with the bad spinner being displayed after the end of the SAML login. This fixes a race between multiple pieces of code changing screen-gaia-signin's |isLoadingUiShown_|. These races led to the "please wait" spinner not being shown in some cases. In particular, one race condition was between (a) setting this flag to true after the successful authentication (done by onAuthCompleted_()) and (b) setting it to false when the authenticator completely loads a third-party page (done by onAuthReady_()). Before this. CL, the flag could stay "false" after the SAML authentication, due to "(b)" happening after "(a)" (after fully loading the Gaia's /programmatic_auth_chromeos page). The fix is to get rid of direct overwrites of the |isLoadingUiShown_| property from different places, and instead make it computed from a few variables that track independent states. Bug: 1024253 Test: perform SAML login on a slow device, verify that after less than a second the "Please wait" spinner is shown Change-Id: I8a9d3dbb859ca4c4bf87e0f9b595ae9410d7937b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000627Reviewed-by:Roman Sorokin [CET] <rsorokin@chromium.org> Commit-Queue: Maksim Ivanov <emaxx@chromium.org> Cr-Commit-Position: refs/heads/master@{#732840}
Showing
Please register or sign in to comment