• Dominique Fauteux-Chapleau's avatar
    Reland "Add testing config for per-profile Connectors" · f529d2a4
    Dominique Fauteux-Chapleau authored
    This is a reland of crrev.com/c/2623812 that was reverted by
    crrev.com/c/2628041. The issue was that enabling per-profile in
    unrelated tests made for a bad combination with realtime URL checks
    (that landed in crrev.com/c/2615779) and resulted in the browser DM
    token reading code being used needlessly. The fix to this is to add an
    optimization to ConnectorsService::GetDMTokenForRealTimeUrlCheck and
    check the main policy value before calling the expensive DM token
    reading code. Aside from that change this reland is identical to
    crrev.com/c/2623812.
    
    Original change's description:
    > Add testing config for per-profile Connectors
    >
    > A small change in ConnectorsService is required to make this test config
    > work. When checking analysis/reporting settings, 2 things are required
    > to obtain settings: a policy set to a valid value and a DM token (from
    > the browser or the profile). The previous implementation checked the DM
    > token first, meaning the blocking BrowserDMTokenStorage::RetrieveDMToken
    > call would trigger on multiple tests and crash them (see patchset 1
    > failures for examples of this).
    >
    > The solution is to simply switch the
    > order of checks and read the policy first. This is also a valid
    > optimization of Connectors logic, as reading prefs is faster than
    > potentially reading the DM token from local storage.
    >
    > Change-Id: Ie1026b57cf7a4fd66663530ec2a77a72f21d6d81
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623812
    > Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
    > Reviewed-by: Marc-André Decoste <mad@chromium.org>
    > Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#843115}
    
    Change-Id: Ie2959239571905251081c39af7cc4b124863890d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628110
    Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
    Reviewed-by: default avatarXinghui Lu <xinghuilu@chromium.org>
    Reviewed-by: default avatarMarc-André Decoste <mad@chromium.org>
    Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#843568}
    f529d2a4
fieldtrial_testing_config.json 239 KB