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

Unified Diff: chrome/browser/prefs/profile_pref_store_manager_unittest.cc

Issue 2767743003: Pref service: Merge connectors and send a PrefRegistry in Connect(). (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: chrome/browser/prefs/profile_pref_store_manager_unittest.cc
diff --git a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc
index ceeed1f047df823f9d0b8de6987a8c8e75fbd0d8..2014761a49753a0f0c686b5ddbc73ed069ed00ba 100644
--- a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc
+++ b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc
@@ -36,7 +36,9 @@
#include "components/user_prefs/tracked/pref_hash_filter.h"
#include "components/user_prefs/tracked/pref_names.h"
#include "content/public/common/service_names.mojom.h"
+#include "services/preferences/public/cpp/persistent_pref_store_client.h"
#include "services/preferences/public/cpp/pref_service_main.h"
+#include "services/preferences/public/interfaces/preferences.mojom.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/service_context.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -306,6 +308,13 @@ class ProfilePrefStoreManagerTest : public testing::TestWithParam<bool> {
base::Bind(&ProfilePrefStoreManagerTest::RecordReset,
base::Unretained(this)),
mock_validation_delegate_.get(), connector_.get());
+ if (!pref_store) {
+ prefs::mojom::PrefStoreConnectorPtr pref_connector;
+ connector_->BindInterface(prefs::mojom::kPrefStoreServiceName,
+ &pref_connector);
+ pref_store = new prefs::PersistentPrefStoreClient(
+ std::move(pref_connector), profile_pref_registry_);
+ }
InitializePrefStore(pref_store.get());
pref_store = NULL;
base::RunLoop().RunUntilIdle();
@@ -368,6 +377,13 @@ class ProfilePrefStoreManagerTest : public testing::TestWithParam<bool> {
base::Bind(&ProfilePrefStoreManagerTest::RecordReset,
base::Unretained(this)),
mock_validation_delegate_.get(), connector_.get());
+ if (!pref_store_) {
+ prefs::mojom::PrefStoreConnectorPtr pref_connector;
+ connector_->BindInterface(prefs::mojom::kPrefStoreServiceName,
+ &pref_connector);
+ pref_store_ = new prefs::PersistentPrefStoreClient(
+ std::move(pref_connector), profile_pref_registry_);
+ }
pref_store_->AddObserver(&registry_verifier_);
PrefStoreReadObserver read_observer(pref_store_);
read_observer.Read();
« no previous file with comments | « chrome/browser/prefs/profile_pref_store_manager.cc ('k') | components/sync_preferences/pref_service_syncable_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698