• cfredric's avatar
    Move Secure cookie check into CanonicalCookie::IsSetPermittedInContext. · 34ed01a8
    cfredric authored
    This cl also converts a portion of CanonicalCookie unit tests to use
    matcher-based code, in order to be able to more easily assert multiple
    things about multiple parts of the return value of
    IsSetPermittedInContext. (E.g., being able to make assertions about both
    the |status| and the |is_allowed_to_access_secure_cookies| fields of the
    |CookieAccessResult|. This also has the benefit of being more
    declarative and avoiding declaring temp variables, which are
    error-prone. In particular, this fixes bugs where the wrong temp
    variable was accidentally used (lines 2785, 2899).
    
    This cl also fixes a bug (in test) where the LEGACY access semantics
    were accidentally unused, with UNKNOWN being redundantly used instead
    (lines 2967-2987).
    
    Change-Id: I09b981f5f0819807ff5dd769022e4d6baa5f50a4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2571806Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarLily Chen <chlily@chromium.org>
    Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#834578}
    34ed01a8
cookie_monster.cc 76.3 KB