Commit cf91f7bf authored by Vaclav Brozek's avatar Vaclav Brozek Committed by Commit Bot

Spare RunUntilIdle in PasswordStoreDefaultTest.Notifications

This CL removes intermediate calls of
scoped_task_environment_.RunUntilIdle() from
PasswordStoreDefaultTest.Notifications and only leaves the last one.
This is enough to verify the test expectations and makes the test
slightly faster in debug mode.

Some local benchmarking showed that in debug configuration on my
machine (Z620, Ubuntu) the test takes 45-50ms before the changes and
about 40ms after it. No siginificant difference was perceived in
release build.

Thanks vasilii@ for spotting this test and suggesting this way of
speeding it up.

Bug: 788875
Change-Id: Ie9b3d6b65ef8a5f99400acc66c097360259e204e
Reviewed-on: https://chromium-review.googlesource.com/803342Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521296}
parent 419d8078
......@@ -207,7 +207,6 @@ TEST(PasswordStoreDefaultTest, Notifications) {
// Adding a login should trigger a notification.
store->AddLogin(*form);
delegate.FinishAsyncProcessing();
// Change the password.
form->password_value = base::ASCIIToUTF16("a different password");
......@@ -221,7 +220,6 @@ TEST(PasswordStoreDefaultTest, Notifications) {
// Updating the login with the new password should trigger a notification.
store->UpdateLogin(*form);
delegate.FinishAsyncProcessing();
const PasswordStoreChange expected_delete_changes[] = {
PasswordStoreChange(PasswordStoreChange::REMOVE, *form),
......@@ -232,6 +230,7 @@ TEST(PasswordStoreDefaultTest, Notifications) {
// Deleting the login should trigger a notification.
store->RemoveLogin(*form);
// Run the tasks to allow all the above expected calls to take place.
delegate.FinishAsyncProcessing();
store->RemoveObserver(&observer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment