Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: services/preferences/pref_service_factory_unittest.cc

Issue 2771723002: Pref service: Merge PrefStoreConnector interfaces. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/preferences/pref_service_factory_unittest.cc
diff --git a/services/preferences/pref_service_factory_unittest.cc b/services/preferences/pref_service_factory_unittest.cc
index a77ff7a816dd672e7f172cf7ffaea2eca8d4323a..462d0d34deb83482a467c4973c4fe078b7e69f69 100644
--- a/services/preferences/pref_service_factory_unittest.cc
+++ b/services/preferences/pref_service_factory_unittest.cc
@@ -137,8 +137,13 @@ class PrefServiceFactoryTest : public base::MessageLoop::DestructionObserver,
std::unique_ptr<PrefService> pref_service) {
DCHECK(pref_service);
*out = std::move(pref_service);
- (*out)->AddPrefInitObserver(
- base::Bind(PrefServiceFactoryTest::OnInit, quit_closure));
+ if ((*out)->GetInitializationStatus() ==
+ PrefService::INITIALIZATION_STATUS_WAITING) {
+ (*out)->AddPrefInitObserver(
+ base::Bind(PrefServiceFactoryTest::OnInit, quit_closure));
+ return;
+ }
+ quit_closure.Run();
}
static void OnPrefChanged(const base::Closure& quit_closure,
« no previous file with comments | « services/preferences/persistent_pref_store_impl_unittest.cc ('k') | services/preferences/pref_store_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698