Index: components/syncable_prefs/pref_service_syncable_unittest.cc |
diff --git a/components/syncable_prefs/pref_service_syncable_unittest.cc b/components/syncable_prefs/pref_service_syncable_unittest.cc |
index 5aaa09616db396c3a53545ddeb412651e6ea4e59..d22b5d6fd6151a26146883ad25285994cb35648a 100644 |
--- a/components/syncable_prefs/pref_service_syncable_unittest.cc |
+++ b/components/syncable_prefs/pref_service_syncable_unittest.cc |
@@ -46,6 +46,10 @@ const char kDefaultCharsetPrefName[] = "default_charset"; |
const char kNonDefaultCharsetValue[] = "foo"; |
const char kDefaultCharsetValue[] = "utf-8"; |
+void Increment(int* num) { |
+ (*num)++; |
+} |
+ |
class TestPrefModelAssociatorClient : public PrefModelAssociatorClient { |
public: |
TestPrefModelAssociatorClient() {} |
@@ -121,7 +125,6 @@ class PrefServiceSyncableTest : public testing::Test { |
pref_sync_service_ = reinterpret_cast<PrefModelAssociator*>( |
prefs_.GetSyncableService(syncer::PREFERENCES)); |
ASSERT_TRUE(pref_sync_service_); |
- next_pref_remote_sync_node_id_ = 0; |
} |
syncer::SyncChange MakeRemoteChange(int64_t id, |
@@ -555,6 +558,17 @@ TEST_F(PrefServiceSyncableTest, DeletePreference) { |
EXPECT_TRUE(pref->IsDefaultValue()); |
} |
+TEST_F(PrefServiceSyncableTest, RegisterMergeDataFinishedCallback) { |
+ int num_callbacks = 0; |
+ |
+ prefs_.RegisterMergeDataFinishedCallback( |
+ base::Bind(&Increment, &num_callbacks)); |
+ EXPECT_EQ(0, num_callbacks); |
+ |
+ InitWithNoSyncData(); |
+ EXPECT_EQ(1, num_callbacks); |
+} |
+ |
} // namespace |
} // namespace syncable_prefs |