• Askar Aitzhan's avatar
    Assume that time is synchronized until response from TLSDate arrives · fcc797cc
    Askar Aitzhan authored
    There is a policy "DeviceOffHours" which defines some time intervals
    when some policies gets deleted from policy blob. Among them there is a
    policy "DeviceGuestModeEnabled". If it's set to false after removing it
    from policy blob it should default to "true", thus allowing browsing as
    a guest.
    
    Before: There is a button on login screen "Browser as Guest", because
    policy "DeviceGuestModeEnabled" defaulted to "true" after deleting it
    from policy blob. But when pressing it Chrome restarts and tries to
    initialize profile synchronously. But "DeviceOffHours" doesn't get
    applied because it's a policy that relies on time, and makes async DBus
    call. So DeviceOffHoursController assumes that time is not reliable and
    logs out the user.
    
    After: Assume that time is reliable until the response from DBus call
    arrived, thus allowing synchronous profile initialization to finish.
    After finishing, response from DBus call arrives and corresponding
    actions are taken (log user out if time is not synchronized).
    
    User log out flow:
    * DeviceOffHoursController::UpdateOffHoursMode               =>
    * DeviceOffHoursController::SetOffHoursMode                  =>
    * DeviceOffHoursController::OffHoursModeIsChanged            =>
    * DeviceSettingsService::Load                                =>
    * DeviceSettingsService::HandleCompletedOperation            =>
    * DeviceSettingsService::NotifyDeviceSettingsUpdated         =>
    * DeviceSettingsProvider::DeviceSettingsUpdated              =>
    * DeviceSettingsProvider::UpdateAndProceedStoring            =>
    * DeviceSettingsProvider::UpdateFromService                  =>
    * DeviceSettingsProvider::UpdateValuesCache                  =>
    * DeviceSettingsProvider::DecodePolicies                     =>
    * DecodeLoginPolicies (in device_settings_provider.cc)       =>
    * DecodeLoginPolicies changes CrosSettings                   =>
    * CrosSettings change gets observed by ChromeUserManagerImpl =>
    * UserManagerBase::NotifyUsersSignInConstraintsChanged       =>
    * UserSessionManager::OnUsersSignInConstraintsChanged        =>
    * AttemptUserExit
    
    Test: Set DeviceGuestModeEnabled to "false", Configure "DeviceOffHours"
    policy to have an interval from Monday 12:00am till Sunday 11:30pm.
    During an Off Hours interval sign in to the device, disable all the
    network connections. Exptectation: user will be kicked out as soon
    network connections are gone.
    
    Bug: 930567
    Change-Id: I4f7fd429ba7cb64cf99a943e1f5e8686801279d5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699667
    Commit-Queue: Askar Aitzhan <askaraitzhan@google.com>
    Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
    Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#682257}
    fcc797cc
fake_system_clock_client.cc 2.19 KB