summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/sync/glue/synchronized_preferences.h4
-rw-r--r--chrome/browser/sync/profile_sync_service_preference_unittest.cc20
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/sync/glue/synchronized_preferences.h b/chrome/browser/sync/glue/synchronized_preferences.h
index 6b4a9086..0ecb3a6 100644
--- a/chrome/browser/sync/glue/synchronized_preferences.h
+++ b/chrome/browser/sync/glue/synchronized_preferences.h
@@ -61,7 +61,11 @@ static const wchar_t* kSynchronizedPreferences[] = {
// Options dialog: Under the hood -> Change font and language settings.
// Serif, San Serif, Fixed font settings not synced.
prefs::kDefaultCharset,
+ // There is no dialog to modify the kAcceptLanguages list on OSX, so
+ // don't sync it.
+#if !defined(OS_MACOSX)
prefs::kAcceptLanguages,
+#endif
prefs::kEnableSpellCheck,
// Spell checker language not synced.
prefs::kApplicationLocale,
diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
index 18f6194..6556c83 100644
--- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
@@ -391,3 +391,23 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) {
EXPECT_EQ(node_id,
model_associator_->GetSyncIdFromChromeId(prefs::kHomePage));
}
+
+TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeUnknownPreference) {
+ CreateRootTask task(this, syncable::PREFERENCES);
+ ASSERT_TRUE(StartSyncService(&task, false));
+ ASSERT_TRUE(task.success());
+
+ scoped_ptr<Value> expected(Value::CreateStringValue(example_url0_));
+ int64 node_id = SetSyncedValue(L"unknown preference", *expected);
+ ASSERT_NE(node_id, sync_api::kInvalidId);
+ scoped_ptr<SyncManager::ChangeRecord> record(new SyncManager::ChangeRecord);
+ record->action = SyncManager::ChangeRecord::ACTION_ADD;
+ record->id = node_id;
+ {
+ sync_api::WriteTransaction trans(backend()->GetUserShareHandle());
+ change_processor_->ApplyChangesFromSyncModel(&trans, record.get(), 1);
+ }
+
+ // Nothing interesting happens on the client when it gets an update
+ // of an unknown preference. We just should not crash.
+}