Make unittests of password_generator to be deterministic
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:Vaclav Brozek <vabr@chromium.org> Cr-Commit-Position: refs/heads/master@{#568782}
Showing
Please register or sign in to comment