• Mihai Sardarescu's avatar
    Wait 1 second before signing in to avoid WKWebView bug on Gaia webpage. · 3652bb1f
    Mihai Sardarescu authored
    During the Chrome sign-in flow, if the user chooses to clear the cookies
    when switching their primary account, then the following actions take
    place (in the following order):
      1. All cookies are cleared.
      2. The user is signed in to Chrome (aka the primary account set)
      2.a. All requests to Gaia page will include Mirror header.
      2.b. Account reconcilor will rebuild the Gaia cookies having the Chrome
         primary account as the Gaia default web account.
    
    The Gaia sign-in webpage monitors changes to its cookies and reloads the page
    whenever they change. Reloading the webpage while the cookies are cleared and
    just before they are rebuilt seems to confuse WKWebView that ends up with a nil
    URL, which in turns translates in about:blank URL shown in the Omnibox.
    
    This CL works around this issue by waiting for 1 second between steps 1 and 2
    above to allow the WKWebView to initiate the reload after the cookies are
    cleared.
    
    Bug: 1003578
    Change-Id: I8dc460854b3047b515c0401bc4e2f233a3fcfa59
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844975Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
    Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#703636}
    3652bb1f
BUILD.gn 6.15 KB