• Jerry Lin's avatar
    Make unittests of password_generator to be deterministic · 48d2aa2c
    Jerry Lin authored
    The tests in components/autofill/c/b/password_generator_fips181_unittest.cc
    use a random source during tests and are thus non-deterministic.
    
    This patch adds a method of PasswordGeneratorFips181 called
    SetGeneratorForTest. It accepts a parameter generate_func so
    PasswordGeneratorFips181 will use this function to generate password to
    achieve deterministic unittesting. Unittest code uses this function to
    set generator for test to make test deterministic.
    
    R=vabr@chromium.org
    
    Bug: 847200
    Change-Id: If2924ed0e59843336f0e642053eefaca4c353163
    Reviewed-on: https://chromium-review.googlesource.com/1084392
    Commit-Queue: Vaclav Brozek <vabr@chromium.org>
    Reviewed-by: default avatarVaclav Brozek <vabr@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#568782}
    48d2aa2c
AUTHORS 37 KB