• Theodore Olsauskas-Warren's avatar
    Add SetClockForTesting to the UserModifiableProvider class · 2cbdd2c0
    Theodore Olsauskas-Warren authored
    To support adjustments to the clock used by a UserModifiableProvider
    during testing, the SetClockForTesting function is elevated to be a
    virtual member of the class. Most subclasses provided this functionality
    by an identical function, with NotificationChannelsProviderAndroid
    providing it via custom constructors.
    
    This CL refactors NotificationChannelsProviderAndroid local clock to align
    with other existing subclasses and updates associated test code.
    
    Additional changes to the SetClockForTesting on the
    HostContentSettingsMap allow it to set the clock on all user_providers
    it is aware of.
    
    Bug: 1032584
    Change-Id: I068b7179375c0e6ce668ae2f2e4d8c0fcfc71cb7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000028
    Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
    Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
    Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#732422}
    2cbdd2c0
notification_channels_provider_android_unittest.cc 30.3 KB