From b55dd3160a59a677852803c8178d47879e655e94 Mon Sep 17 00:00:00 2001 From: Viktor Semeniuk Date: Mon, 14 Jun 2021 17:14:50 +0000 Subject: [PATCH] Fixes flakiness caused by https://crrev.com/c/2909862 This CL fixes flakiness in ProfileBrowserTestWithoutDestroyProfile.DestroyRegularProfileBeforeOTRs. Before changing the pref value we should also make sure prefs_ exist and ShutdownOnUIThread wasn't called. Bug: 1217988 Change-Id: I5f9ccc7c28710f174d03aeef78aad33954dbb950 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2953346 Commit-Queue: Viktor Semeniuk Reviewed-by: Vasilii Sukhanov Cr-Commit-Position: refs/heads/master@{#892131} --- components/password_manager/core/browser/password_store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 62c925283856cc..691b518d36fae4 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc @@ -1328,7 +1328,7 @@ bool PasswordStore::RemoveOldGoogleLogins() { } void PasswordStore::MarkOldGoogleLoginsRemoved(bool success) { - if (success) { + if (success && prefs_ && !shutdown_called_) { prefs_->SetBoolean(prefs::kWereOldGoogleLoginsRemoved, true); } }